blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
721
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
57
| license_type
stringclasses 2
values | repo_name
stringlengths 5
91
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 321
values | visit_date
timestamp[ns]date 2016-08-12 09:31:09
2023-09-06 10:45:07
| revision_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| committer_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| github_id
int64 426
681M
| star_events_count
int64 101
243k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 23
values | gha_event_created_at
timestamp[ns]date 2012-06-28 18:51:49
2023-09-14 21:59:16
⌀ | gha_created_at
timestamp[ns]date 2008-02-11 22:55:26
2023-08-10 11:14:58
⌀ | gha_language
stringclasses 147
values | src_encoding
stringclasses 26
values | language
stringclasses 2
values | is_vendor
bool 2
classes | is_generated
bool 2
classes | length_bytes
int64 6
10.2M
| extension
stringclasses 115
values | filename
stringlengths 3
113
| content
stringlengths 6
10.2M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
192c74547aa5030920b4f5747711f873f2cb5414
|
7f6c235b0598353549959c18f69eefd20b766907
|
/src/appmake/trs80.c
|
071469aaf1199eca6938a67851fc42661afb1510
|
[
"ClArtistic"
] |
permissive
|
z88dk/z88dk
|
46dfd4905f36d99333173cadd0a660839befc9f0
|
8b07f37cc43c5d9ffe69b563c80763491d8faff7
|
refs/heads/master
| 2023-09-04T19:29:49.254958
| 2023-09-03T20:51:24
| 2023-09-03T20:51:24
| 54,035,569
| 820
| 263
|
NOASSERTION
| 2023-09-05T11:09:04
| 2016-03-16T13:48:16
|
Assembly
|
UTF-8
|
C
| false
| false
| 10,349
|
c
|
trs80.c
|
/*
* BIN to TRS 80 file conversion
*
* Stefano Bodrato, April 2008
*
* CAS format ( Stefano Bodrato, Jul 2014 )
* To load machine code programs from tape, first type 'SYSTEM' to exit BASIC
* then at the '*?' prompt enter the program name (or its first letter) and press PLAY
* When the program is in memory, type '/'.
*
* CO format ( Stefano Bodrato, Feb 2020 )
* Support for Olivetti M10, Kyotronic KC85, TRS80 M100, etc..
*
*
* $Id: trs80.c $
*/
#include "appmake.h"
static char *binname = NULL;
static char *crtfile = NULL;
static char *outfile = NULL;
static int origin = -1;
static char cmd = 0;
static char co = 0;
static int blocksz = 256;
static char audio = 0;
static char fast = 0;
static char khz_22 = 0;
static char dumb = 0;
static char loud = 0;
static char help = 0;
static char bit_state = 0;
static uint8_t h_lvl;
static uint8_t l_lvl;
static uint8_t trs_h_lvl;
static uint8_t trs_l_lvl;
/* Options that are available for this module */
option_t trs80_options[] = {
{ 'h', "help", "Display this help", OPT_BOOL, &help},
{ 'b', "binfile", "Linked binary file", OPT_STR, &binname },
{ 'c', "crt0file", "crt0 file used in linking", OPT_STR, &crtfile },
{ 'o', "output", "Name of output file", OPT_STR, &outfile },
{ 0 , "cmd", ".CMD file format", OPT_BOOL, &cmd },
{ 0 , "co", "M100 .CO format", OPT_BOOL, &co },
{ 0 , "blocksz", "Block size (10..256)", OPT_INT, &blocksz },
{ 0, "audio", "Create also a WAV file", OPT_BOOL, &audio },
{ 0, "fast", "Tweak the audio tones to run a bit faster", OPT_BOOL, &fast },
{ 0, "22", "22050hz bitrate option", OPT_BOOL, &khz_22 },
{ 0, "dumb", "Just convert to WAV a tape file", OPT_BOOL, &dumb },
{ 0, "loud", "Louder audio volume", OPT_BOOL, &loud },
{ 0 , "org", "Origin of the binary", OPT_INT, &origin },
{ 0, NULL, NULL, OPT_NONE, NULL }
};
void writeword(unsigned int, FILE*);
void trs80_pulse(FILE* fpout)
{
if (loud) {
trs_h_lvl = 0xFF;
trs_l_lvl = 0;
} else {
trs_h_lvl = 0xe0;
trs_l_lvl = 0x20;
}
if (bit_state) {
h_lvl = trs_h_lvl;
l_lvl = trs_l_lvl;
} else {
h_lvl = trs_l_lvl;
l_lvl = trs_h_lvl;
}
fputc(h_lvl - 0x20, fpout);
fputc(h_lvl, fpout);
fputc(h_lvl, fpout);
fputc(h_lvl + 0x20, fpout);
fputc(l_lvl - 0x20, fpout);
fputc(l_lvl, fpout);
fputc(l_lvl, fpout);
fputc(l_lvl + 0x20, fpout);
}
void trs80_rawout(FILE* fpout, unsigned char b)
{
static unsigned char c[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
int i, j;
/* byte */
for (i = 0; i < 8; i++) {
/* bit */
if (b & c[i]) {
trs80_pulse(fpout);
if (fast) {
for (j = 0; j < 34; j++)
fputc(0x80, fpout);
} else {
for (j = 0; j < 40; j++)
fputc(0x80, fpout);
}
trs80_pulse(fpout);
if (fast) {
for (j = 0; j < 34; j++)
fputc(0x80, fpout);
} else {
for (j = 0; j < 40; j++)
fputc(0x80, fpout);
}
} else {
trs80_pulse(fpout);
if (fast) {
for (j = 0; j < 76; j++)
fputc(0x80, fpout);
} else {
for (j = 0; j < 88; j++)
fputc(0x80, fpout);
}
}
}
}
int trs80_exec(char* target)
{
char filename[FILENAME_MAX + 1];
char wavfile[FILENAME_MAX + 1];
char name[11];
FILE *fpin, *fpout;
int c;
int i;
int len;
int pos;
unsigned char cksum = 0;
char ckflag = 0;
if (help || binname == NULL || (!dumb && (crtfile == NULL))) {
return -1;
}
if (origin != -1) {
pos = origin;
} else {
if ((pos = get_org_addr(crtfile)) == -1) {
exit_log(1,"Could not find parameter ZORG (not z88dk compiled?)\n");
}
}
if (co)
cmd = co;
if (audio)
co = cmd = 0;
if ((blocksz < 10) || (blocksz > 256)) {
exit_log(1,"Invalid block size: %d\n", blocksz);
}
if (cmd)
blocksz -= 2;
if (dumb) {
strcpy(filename, binname);
} else {
if (outfile == NULL) {
strcpy(filename, binname);
if (cmd)
if (co)
suffix_change(filename, ".co");
else
suffix_change(filename, ".cmd");
else
suffix_change(filename, ".cas");
} else {
strcpy(filename, outfile);
}
if ((fpin = fopen_bin(binname, crtfile)) == NULL) {
exit_log(1, "Can't open input file %s\n", binname);
}
/*
* Now we try to determine the size of the file
* to be converted
*/
if (fseek(fpin, 0, SEEK_END)) {
fclose(fpin);
exit_log(1,"Couldn't determine size of file\n");
}
len = ftell(fpin);
fseek(fpin, 0L, SEEK_SET);
/*
* CMD file creation
*/
if ((fpout = fopen(filename, "wb")) == NULL) {
exit_log(1, "Can't open output CMD file %s\n", filename);
}
if (!cmd) {
/*
* CAS file mode
*/
for (i = 0; i < 256; i++)
fputc(0, fpout);
fputc(0xA5, fpout); /* sync byte */
fputc(0x55, fpout); /* system type filename header identifier */
/* Deal with the filename */
snprintf(name, sizeof(name), "%-*s", (int) sizeof(name)-1, binname);
for (i = 0; i < 6; i++)
writebyte(toupper(name[i]), fpout);
}
/*
* Main loop
*/
if (!co) {
for (i = 0; i < len; i++) {
if ((i % blocksz) == 0) {
if (cmd)
writebyte(1, fpout); /* Block signature byte in CMD mode */
else
writebyte(0x3c, fpout); /* Escape char for data block signature in CAS mode */
if ((i + blocksz) > len)
if (cmd)
writebyte(len - i + 2, fpout); /* last block length (remainder) */
else
writebyte(len - i, fpout); /* last block length (remainder) */
else if (cmd)
if (blocksz == 254)
writebyte(0, fpout); /* block length (256 bytes) */
else
writebyte(blocksz + 2, fpout); /* block length */
else if (blocksz == 256)
writebyte(0, fpout); /* block length (256 bytes) */
else
writebyte(blocksz, fpout); /* block length (CAS mode)*/
writeword(pos + i, fpout); /* block memory location */
cksum = (pos + i) % 256 + (pos + i) / 256; /* Checksum (for CAS mode) */
}
c = getc(fpin);
cksum += c; /* Checksum (for CAS mode) */
fputc(c, fpout);
ckflag = 1;
if (!cmd && ((i + 1) % blocksz == 0)) {
writebyte(cksum, fpout); /* Checksum (for CAS mode) */
ckflag = 0;
}
}
if (cmd) {
writebyte(2, fpout); /* Two bytes end marker in CMD mode*/
writebyte(2, fpout);
} else {
if (ckflag)
writebyte(cksum, fpout); /* Checksum */
writebyte(0x78, fpout); /* Escape char for EOF in CAS mode */
}
}
writeword(pos, fpout); /* Start address */
if (co) {
writeword(len, fpout); /* Program length */
writeword(pos, fpout); /* Program entry */
for (i = 0; i < len; i++) {
c = getc(fpin);
fputc(c, fpout);
}
}
fclose(fpin);
fclose(fpout);
}
/* ***************************************** */
/* Now, if requested, create the audio file */
/* ***************************************** */
if ((audio) || (fast) || (khz_22) || (loud)) {
if ((fpin = fopen(filename, "rb")) == NULL) {
exit_log(1,"Can't open file %s for wave conversion\n", filename);
}
if (fseek(fpin, 0, SEEK_END)) {
fclose(fpin);
exit_log(1,"Couldn't determine size of file\n");
}
len = ftell(fpin);
fseek(fpin, 0, SEEK_SET);
strcpy(wavfile, filename);
suffix_change(wavfile, ".RAW");
if ((fpout = fopen(wavfile, "wb")) == NULL) {
exit_log(1, "Can't open output raw audio file %s\n", wavfile);
}
/* leading silence */
for (i = 0; i < 0x3000; i++)
fputc(0x80, fpout);
/* Skip the tone leader bytes */
do {
len--;
c = getc(fpin);
} while ((c == 0) && (len > 0));
if (len < 10) {
exit_log(1,"Invalid .CAS file %s\n", filename);
}
if (c != 0xA5) {
exit_log(1, "Header marker not found: 0xA5\n");
}
len--;
c = getc(fpin);
/*
if ( c != 0x55 ) {
fprintf(stderr,"Header marker not found:0x55\n");
myexit(NULL,1);
}
*/
for (i = 0; i < 600; i++) {
trs80_rawout(fpout, 0);
}
trs80_rawout(fpout, 0xa5);
trs80_rawout(fpout, c);
/* Show filename */
if (dumb)
printf("\nInfo: Program Name found in header: ");
for (i = 0; (i < 6); i++) {
c = getc(fpin);
if (dumb)
printf("%c", c);
trs80_rawout(fpout, c);
}
if (dumb)
printf("\n");
/* Short extra pause */
for (i = 0; i < 48; i++)
fputc(0x80, fpout);
if (len > 0) {
for (i = 0; i < len; i++) {
c = getc(fpin);
trs80_rawout(fpout, c);
}
}
fclose(fpin);
fclose(fpout);
/* Now complete with the WAV header */
if (khz_22)
raw2wav_22k(wavfile,2);
else
raw2wav(wavfile);
} /* END of WAV CONVERSION BLOCK */
return 0;
}
|
fcc3a64599fe2ecada6fa110e05135ab714aca5d
|
9de0cec678bc4a3bec2b4adabef9f39ff5b4afac
|
/PWGLF/RESONANCES/macros/mini/qa/ConfigRsnQA.C
|
4d7a7b0667f31b1007959259be986ffcee1bfa34
|
[] |
permissive
|
alisw/AliPhysics
|
91bf1bd01ab2af656a25ff10b25e618a63667d3e
|
5df28b2b415e78e81273b0d9bf5c1b99feda3348
|
refs/heads/master
| 2023-08-31T20:41:44.927176
| 2023-08-31T14:51:12
| 2023-08-31T14:51:12
| 61,661,378
| 129
| 1,150
|
BSD-3-Clause
| 2023-09-14T18:48:45
| 2016-06-21T19:31:29
|
C++
|
UTF-8
|
C
| false
| false
| 5,205
|
c
|
ConfigRsnQA.C
|
/***************************************************************************
// Created on 22.03.2017 by
// Francesca Bellini f(bellini@cern.ch)
// Sourav Kundu (sourav.kundu@cern.ch)
//
// Configures Phi analysis with rsn mini package for QA
// Allows basic configuration of pile-up check and event cuts
//
****************************************************************************/
Bool_t ConfigRsnQA(AliRsnMiniAnalysisTask *task,
Bool_t isMC,
AliRsnCutSet *cutsPair,
Int_t aodFilterBit = 5,
Bool_t enableMonitor = kTRUE,
TString monitorOpt = "NoSIGN",
Bool_t useGeoCutsPbPb2015 = kFALSE)
{
//Configure phi
TString partname = "kPhi";
Int_t pdgCode = 333;
Float_t mass = 1.019461;
Float_t masslow = 0.980;
Float_t massup = 1.100;
Int_t nbins = 120;
RSNPID d1 = AliRsnDaughter::kKaon;
RSNPID d2 = AliRsnDaughter::kKaon;
// -- Values ------------------------------------------------------------------------------------
AliRsnMiniValue::EType yaxisVar = AliRsnMiniValue::kPt;
/* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE);
/* IM resolution */ Int_t resID = task->CreateValue(AliRsnMiniValue::kInvMassRes, kTRUE);
/* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE);
/* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE);
/* pseudorapidity */ Int_t etaID = task->CreateValue(AliRsnMiniValue::kEta, kFALSE);
/* rapidity */ Int_t yID = task->CreateValue(AliRsnMiniValue::kY, kFALSE);
// set daughter cuts
//use default quality cuts std 2011 with crossed rows TPC
Bool_t useCrossedRows = 1; Float_t nsigma = 3.0;
AliRsnCutTrackQuality* trkQualityCut = new AliRsnCutTrackQuality("myQualityCut");
trkQualityCut->SetDefaults2011(kTRUE,kTRUE);
if (useGeoCutsPbPb2015) trkQualityCut->GetESDtrackCuts()->SetCutGeoNcrNcl(3., 130., 1.5, 0.85, 0.7);
AliRsnCutSetDaughterParticle* cutSetKa = new AliRsnCutSetDaughterParticle(Form("cutK%i_%2.1fsigma",AliRsnCutSetDaughterParticle::kFastTPCpidNsigma, nsigma),trkQualityCut,AliRsnCutSetDaughterParticle::kFastTPCpidNsigma,AliPID::kKaon,nsigma);
Int_t iCutKa = task->AddTrackCuts(cutSetKa);
if (enableMonitor){
Printf("======== Cut monitoring enabled");
gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/RESONANCES/macros/mini/AddMonitorOutput.C");
AddMonitorOutput(isMC, cutSetKa->GetMonitorOutput()), monitorOpt.Data();
}
// -- Create all needed outputs -----------------------------------------------------------------
// use an array for more compact writing, which are different on mixing and charges
// [0] = unlike
// [1] = mixing
Bool_t use [8] = { 1 , 1 , 1 ,isMC , isMC , isMC, isMC , isMC};
TString xvar [8] = { "M", "M", "M", "M", "M", "Res", "Eta", "Eta"};
TString yvar [8] = { "Pt", "Pt", "Pt", "Pt", "Pt", "Pt", "Pt", "Pt"};
Bool_t useIM [8] = { 1 , 1 , 1 ,1 , 1 , 0 , 1 , 1 };
TString name [8] = {"Unlike","LikePP","LikeMM","Gen" ,"Trues" , "Res" , "Gen", "Trues"};
TString comp [8] = {"PAIR" ,"PAIR" ,"PAIR" ,"MOTHER","TRUE" , "TRUE", "MOTHER", "TRUE"};
Char_t charge1[8] = {'+' ,'+' ,'-' , '+' , '+' , '+' , '+' , '+'};
Char_t charge2[8] = {'-' ,'+' ,'-' , '-' , '-' , '-' , '-' , '-'};
TString output = "HIST";
for(Int_t i=0;i<8;i++){
if(!use[i]) continue;
TString histname = Form("%s_%s%s", name[i].Data(), xvar[i].Data(), yvar[i].Data());
AliRsnMiniOutput* outpt = task->CreateOutput(histname.Prepend("phi_"), output.Data(), comp[i].Data());
outpt->SetCutID(0,iCutKa);
outpt->SetCutID(1,iCutKa);
outpt->SetDaughter(0, d1);
outpt->SetDaughter(1, d2);
outpt->SetCharge(0,charge1[i]);
outpt->SetCharge(1,charge2[i]);
outpt->SetMotherPDG(pdgCode);
outpt->SetMotherMass(mass);
outpt->SetPairCuts(cutsPair);
if (i<6) {
if(useIM[i]) outpt->AddAxis(imID,nbins, masslow, massup);
else outpt->AddAxis(resID, 200, -0.02, 0.02);
} else {
outpt->AddAxis(etaID, 20,-1.,1.);
}
outpt->AddAxis(ptID, 100, 0., 20.);
}
// if (isMC) {
// AliRsnMiniOutput * outgenrap = task->CreateOutput("phirap_gen", output.Data(),"MOTHER");
// outgenrap->SetDaughter(0, d1);
// outgenrap->SetDaughter(1, d2);
// outgenrap->SetMotherPDG(pdgCode);
// outgenrap->SetMotherMass(mass);
// outgenrap->SetPairCuts(cutsPair);
// outgenpt->AddAxis(ptID, 100, 0., 10.);
// outgenrap->AddAxis(etaID, 16,-0.8,0.8);
// AliRsnMiniOutput * outrecrap = task->CreateOutput("phirap_rec", output.Data(),"Trues");
// outrecrap->SetDaughter(0, d1);
// outrecrap->SetDaughter(1, d2);
// outrecrap->SetMotherPDG(pdgCode);
// outrecrap->SetMotherMass(mass);
// outrecrap->SetPairCuts(cutsPair);
// outrecpt->AddAxis(ptID, 100, 0., 10.);
// outrecrap->AddAxis(etaID, 16,-0.8,0.8);
// }
return kTRUE;
}
|
5d1cbf2686d08b6720064bc6c3b61e1f17793276
|
e73547787354afd9b717ea57fe8dd0695d161821
|
/include/mapfs/kpa_40_shape.h
|
463d08fd304b4ffddd123de7ee906709a1e294c2
|
[] |
no_license
|
pmret/papermario
|
8b514b19653cef8d6145e47499b3636b8c474a37
|
9774b26d93f1045dd2a67e502b6efc9599fb6c31
|
refs/heads/main
| 2023-08-31T07:09:48.951514
| 2023-08-21T18:07:08
| 2023-08-21T18:07:08
| 287,151,133
| 904
| 139
| null | 2023-09-14T02:44:23
| 2020-08-13T01:22:57
|
C
|
UTF-8
|
C
| false
| false
| 3,520
|
h
|
kpa_40_shape.h
|
#define MODEL_Root 0x5C
#define MODEL_g81 0x5B
#define MODEL_g83 0x5A
#define MODEL_o526 0x59
#define MODEL_g82 0x58
#define MODEL_o525 0x57
#define MODEL_akari 0x56
#define MODEL_hi8 0x55
#define MODEL_hi9 0x54
#define MODEL_hi11 0x53
#define MODEL_hi10 0x52
#define MODEL_chandelier 0x51
#define MODEL_s_kusari 0x50
#define MODEL_s_tetuwa 0x4F
#define MODEL_unit_1f_left 0x4E
#define MODEL_o257 0x4D
#define MODEL_g57 0x4C
#define MODEL_ami 0x4B
#define MODEL_g59 0x4A
#define MODEL_o468 0x49
#define MODEL_o461 0x48
#define MODEL_o423 0x47
#define MODEL_o422 0x46
#define MODEL_g78 0x45
#define MODEL_o514 0x44
#define MODEL_o513 0x43
#define MODEL_o512 0x42
#define MODEL_o511 0x41
#define MODEL_g73 0x40
#define MODEL_o491 0x3F
#define MODEL_o490 0x3E
#define MODEL_o489 0x3D
#define MODEL_o488 0x3C
#define MODEL_o437 0x3B
#define MODEL_o436 0x3A
#define MODEL_o435 0x39
#define MODEL_o434 0x38
#define MODEL_o433 0x37
#define MODEL_o432 0x36
#define MODEL_o430 0x35
#define MODEL_g84 0x34
#define MODEL_f1_ami 0x33
#define MODEL_o529 0x32
#define MODEL_o256 0x31
#define MODEL_o255 0x30
#define MODEL_o253 0x2F
#define MODEL_o518 0x2E
#define MODEL_o530 0x2D
#define MODEL_o517 0x2C
#define MODEL_o295 0x2B
#define MODEL_o293 0x2A
#define MODEL_o292 0x29
#define MODEL_o291 0x28
#define MODEL_o431 0x27
#define MODEL_o297 0x26
#define MODEL_o429 0x25
#define MODEL_o428 0x24
#define MODEL_kaidann 0x23
#define MODEL_o305 0x22
#define MODEL_o304 0x21
#define MODEL_k_kaidan 0x20
#define MODEL_exit4 0x1F
#define MODEL_o341 0x1E
#define MODEL_e4_isi 0x1D
#define MODEL_e4_hisi 0x1C
#define MODEL_e4_sai 0x1B
#define MODEL_e4_zyuutan 0x1A
#define MODEL_exit3 0x19
#define MODEL_o368 0x18
#define MODEL_exit2 0x17
#define MODEL_o390 0x16
#define MODEL_o389 0x15
#define MODEL_o388 0x14
#define MODEL_o387 0x13
#define MODEL_o386 0x12
#define MODEL_exit1 0x11
#define MODEL_o406 0x10
#define MODEL_o357 0xF
#define MODEL_o356 0xE
#define MODEL_o355 0xD
#define MODEL_o354 0xC
#define MODEL_o353 0xB
#define MODEL_o352 0xA
#define MODEL_o351 0x9
#define MODEL_saku 0x8
#define MODEL_o121 0x7
#define MODEL_yuka 0x6
#define MODEL_o417 0x5
#define MODEL_y2_zyuutan 0x4
#define MODEL_zyuuan 0x3
#define MODEL_isi 0x2
#define MODEL_y2_isi 0x1
#define MODEL_o416 0x0
|
9f305084ea2bcb5ddede1b7e672c41f402f619b8
|
65af307ce12393fd755452cbecc11a6787a3ea59
|
/cmd/genlib/cuda.h
|
5608b5f256170dabfa2cebededc8b5c53e039674
|
[
"Apache-2.0",
"GPL-1.0-or-later"
] |
permissive
|
gorgonia/cu
|
c9e7fc728d9cbf32fe6e7775a80e2d5b10031d32
|
98d52991e7a9a3f81b5d24a557e599eea1273376
|
refs/heads/master
| 2022-11-18T19:55:03.292528
| 2022-11-15T01:05:26
| 2022-11-15T01:05:26
| 82,639,579
| 369
| 48
|
Apache-2.0
| 2022-11-15T01:05:27
| 2017-02-21T05:24:11
|
Go
|
UTF-8
|
C
| false
| false
| 81,314
|
h
|
cuda.h
|
typedef long unsigned int size_t;
typedef int wchar_t;
typedef enum {
P_ALL,
P_PID,
P_PGID
} idtype_t;
typedef struct {
int quot;
int rem;
} div_t;
typedef struct {
long int quot;
long int rem;
} ldiv_t;
__extension__ typedef struct {
long long int quot;
long long int rem;
} lldiv_t;
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__, __leaf__)) ;
extern double atof (const char* __nptr)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern int atoi (const char* __nptr)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern long int atol (const char* __nptr)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
__extension__ extern long long int atoll (const char* __nptr)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern double strtod (const char* __restrict __nptr,
char** __restrict __endptr)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern float strtof (const char* __restrict __nptr,
char** __restrict __endptr) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long double strtold (const char* __restrict __nptr,
char** __restrict __endptr)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int strtol (const char* __restrict __nptr,
char** __restrict __endptr, int __base)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern unsigned long int strtoul (const char* __restrict __nptr,
char** __restrict __endptr, int __base)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoq (const char* __restrict __nptr,
char** __restrict __endptr, int __base)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtouq (const char* __restrict __nptr,
char** __restrict __endptr, int __base)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoll (const char* __restrict __nptr,
char** __restrict __endptr, int __base)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtoull (const char* __restrict __nptr,
char** __restrict __endptr, int __base)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern char* l64a (long int __n) __attribute__ ((__nothrow__, __leaf__)) ;
extern long int a64l (const char* __s)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;
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;
typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;
typedef long int __quad_t;
typedef unsigned long int __u_quad_t;
typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct {
int __val[2];
} __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef int __daddr_t;
typedef int __key_t;
typedef int __clockid_t;
typedef void* __timer_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;
typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;
typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;
typedef long int __fsword_t;
typedef long int __ssize_t;
typedef long int __syscall_slong_t;
typedef unsigned long int __syscall_ulong_t;
typedef __off64_t __loff_t;
typedef char* __caddr_t;
typedef long int __intptr_t;
typedef unsigned int __socklen_t;
typedef int __sig_atomic_t;
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;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
typedef __off_t off_t;
typedef __pid_t pid_t;
typedef __id_t id_t;
typedef __ssize_t ssize_t;
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
typedef __clock_t clock_t;
typedef __clockid_t clockid_t;
typedef __time_t time_t;
typedef __timer_t timer_t;
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
typedef int register_t __attribute__ ((__mode__ (__word__)));
static __inline unsigned int
__bswap_32 (unsigned int __bsx) {
return __builtin_bswap32 (__bsx);
}
static __inline __uint64_t
__bswap_64 (__uint64_t __bsx) {
return __builtin_bswap64 (__bsx);
}
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;
}
typedef struct {
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
typedef __sigset_t sigset_t;
struct timeval {
__time_t tv_sec;
__suseconds_t tv_usec;
};
struct timespec {
__time_t tv_sec;
__syscall_slong_t tv_nsec;
};
typedef __suseconds_t suseconds_t;
typedef long int __fd_mask;
typedef struct {
__fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
} fd_set;
typedef __fd_mask fd_mask;
extern int select (int __nfds, fd_set* __restrict __readfds,
fd_set* __restrict __writefds,
fd_set* __restrict __exceptfds,
struct timeval* __restrict __timeout);
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);
extern unsigned int gnu_dev_major (__dev_t __dev) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__));
extern unsigned int gnu_dev_minor (__dev_t __dev) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__));
extern __dev_t gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__));
typedef __blksize_t blksize_t;
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
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;
int __cur_writer;
int __shared;
signed char __rwelision;
unsigned char __pad1[7];
unsigned long int __pad2;
unsigned int __flags;
};
typedef struct __pthread_internal_list {
struct __pthread_internal_list* __prev;
struct __pthread_internal_list* __next;
} __pthread_list_t;
struct __pthread_mutex_s {
int __lock ;
unsigned int __count;
int __owner;
unsigned int __nusers;
int __kind;
short __spins;
short __elision;
__pthread_list_t __list;
};
struct __pthread_cond_s {
__extension__ union {
__extension__ unsigned long long int __wseq;
struct {
unsigned int __low;
unsigned int __high;
} __wseq32;
} foo;
__extension__ union {
__extension__ unsigned long long int __g1_start;
struct {
unsigned int __low;
unsigned int __high;
} __g1_start32;
} bar ;
unsigned int __g_refs[2] ;
unsigned int __g_size[2];
unsigned int __g1_orig_size;
unsigned int __wrefs;
unsigned int __g_signals[2];
};
typedef unsigned long int pthread_t;
typedef union {
char __size[4];
int __align;
} pthread_mutexattr_t;
typedef union {
char __size[4];
int __align;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef int pthread_once_t;
union pthread_attr_t {
char __size[56];
long int __align;
};
typedef union pthread_attr_t pthread_attr_t;
typedef union {
struct __pthread_mutex_s __data;
char __size[40];
long int __align;
} pthread_mutex_t;
typedef union {
struct __pthread_cond_s __data;
char __size[48];
__extension__ long long int __align;
} pthread_cond_t;
typedef union {
struct __pthread_rwlock_arch_t __data;
char __size[56];
long int __align;
} pthread_rwlock_t;
typedef union {
char __size[8];
long int __align;
} pthread_rwlockattr_t;
typedef volatile int pthread_spinlock_t;
typedef union {
char __size[32];
long int __align;
} pthread_barrier_t;
typedef union {
char __size[4];
int __align;
} pthread_barrierattr_t;
extern long int random (void) __attribute__ ((__nothrow__, __leaf__));
extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__, __leaf__));
extern char* initstate (unsigned int __seed, char* __statebuf,
size_t __statelen) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (2)));
extern char* setstate (char* __statebuf) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
struct random_data {
int32_t* fptr;
int32_t* rptr;
int32_t* state;
int rand_type;
int rand_deg;
int rand_sep;
int32_t* end_ptr;
};
extern int random_r (struct random_data* __restrict __buf,
int32_t* __restrict __result) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int srandom_r (unsigned int __seed, struct random_data* __buf)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int initstate_r (unsigned int __seed, char* __restrict __statebuf,
size_t __statelen,
struct random_data* __restrict __buf)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern int setstate_r (char* __restrict __statebuf,
struct random_data* __restrict __buf)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int rand (void) __attribute__ ((__nothrow__, __leaf__));
extern void srand (unsigned int __seed) __attribute__ ((__nothrow__, __leaf__));
extern int rand_r (unsigned int* __seed) __attribute__ ((__nothrow__, __leaf__));
extern double drand48 (void) __attribute__ ((__nothrow__, __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int lrand48 (void) __attribute__ ((__nothrow__, __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int mrand48 (void) __attribute__ ((__nothrow__, __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void srand48 (long int __seedval) __attribute__ ((__nothrow__, __leaf__));
extern unsigned short int* seed48 (unsigned short int __seed16v[3])
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
struct drand48_data {
unsigned short int __x[3];
unsigned short int __old_x[3];
unsigned short int __c;
unsigned short int __init;
__extension__ unsigned long long int __a;
};
extern int drand48_r (struct drand48_data* __restrict __buffer,
double* __restrict __result) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
struct drand48_data* __restrict __buffer,
double* __restrict __result) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int lrand48_r (struct drand48_data* __restrict __buffer,
long int* __restrict __result)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
struct drand48_data* __restrict __buffer,
long int* __restrict __result)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int mrand48_r (struct drand48_data* __restrict __buffer,
long int* __restrict __result)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
struct drand48_data* __restrict __buffer,
long int* __restrict __result)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int srand48_r (long int __seedval, struct drand48_data* __buffer)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int seed48_r (unsigned short int __seed16v[3],
struct drand48_data* __buffer) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int lcong48_r (unsigned short int __param[7],
struct drand48_data* __buffer)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void* malloc (size_t __size) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__malloc__)) ;
extern void* calloc (size_t __nmemb, size_t __size)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__malloc__)) ;
extern void* realloc (void* __ptr, size_t __size)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__warn_unused_result__));
extern void free (void* __ptr) __attribute__ ((__nothrow__, __leaf__));
extern void* alloca (size_t __size) __attribute__ ((__nothrow__, __leaf__));
extern void* valloc (size_t __size) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__malloc__)) ;
extern int posix_memalign (void** __memptr, size_t __alignment, size_t __size)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern void* aligned_alloc (size_t __alignment, size_t __size)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ;
extern void abort (void) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int on_exit (void (*__func) (int __status, void* __arg), void* __arg)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void exit (int __status) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__noreturn__));
extern void quick_exit (int __status) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__noreturn__));
extern void _Exit (int __status) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__noreturn__));
extern char* getenv (const char* __name) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int putenv (char* __string) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int setenv (const char* __name, const char* __value, int __replace)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int unsetenv (const char* __name) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int clearenv (void) __attribute__ ((__nothrow__, __leaf__));
extern char* mktemp (char* __template) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int mkstemp (char* __template) __attribute__ ((__nonnull__ (1))) ;
extern int mkstemps (char* __template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
extern char* mkdtemp (char* __template) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int system (const char* __command) ;
extern char* realpath (const char* __restrict __name,
char* __restrict __resolved) __attribute__ ((__nothrow__, __leaf__)) ;
typedef int (*__compar_fn_t) (const void*, const void*);
extern void* bsearch (const void* __key, const void* __base,
size_t __nmemb, size_t __size, __compar_fn_t __compar)
__attribute__ ((__nonnull__ (1, 2, 5))) ;
extern void qsort (void* __base, size_t __nmemb, size_t __size,
__compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
extern int abs (int __x) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__)) ;
__extension__ extern long long int llabs (long long int __x)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__)) ;
extern div_t div (int __numer, int __denom)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__)) ;
__extension__ extern lldiv_t lldiv (long long int __numer,
long long int __denom)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__)) ;
extern char* ecvt (double __value, int __ndigit, int* __restrict __decpt,
int* __restrict __sign) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char* fcvt (double __value, int __ndigit, int* __restrict __decpt,
int* __restrict __sign) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char* gcvt (double __value, int __ndigit, char* __buf)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3))) ;
extern char* qecvt (long double __value, int __ndigit,
int* __restrict __decpt, int* __restrict __sign)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char* qfcvt (long double __value, int __ndigit,
int* __restrict __decpt, int* __restrict __sign)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char* qgcvt (long double __value, int __ndigit, char* __buf)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3))) ;
extern int ecvt_r (double __value, int __ndigit, int* __restrict __decpt,
int* __restrict __sign, char* __restrict __buf,
size_t __len) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int* __restrict __decpt,
int* __restrict __sign, char* __restrict __buf,
size_t __len) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qecvt_r (long double __value, int __ndigit,
int* __restrict __decpt, int* __restrict __sign,
char* __restrict __buf, size_t __len)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
int* __restrict __decpt, int* __restrict __sign,
char* __restrict __buf, size_t __len)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int mblen (const char* __s, size_t __n) __attribute__ ((__nothrow__, __leaf__));
extern int mbtowc (wchar_t* __restrict __pwc,
const char* __restrict __s, size_t __n) __attribute__ ((__nothrow__, __leaf__));
extern int wctomb (char* __s, wchar_t __wchar) __attribute__ ((__nothrow__, __leaf__));
extern size_t mbstowcs (wchar_t* __restrict __pwcs,
const char* __restrict __s, size_t __n) __attribute__ ((__nothrow__, __leaf__));
extern size_t wcstombs (char* __restrict __s,
const wchar_t* __restrict __pwcs, size_t __n)
__attribute__ ((__nothrow__, __leaf__));
extern int rpmatch (const char* __response) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int getsubopt (char** __restrict __optionp,
char* const* __restrict __tokens,
char** __restrict __valuep)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
extern int getloadavg (double __loadavg[], int __nelem)
__attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;
typedef long int int_least64_t;
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;
typedef unsigned long int uint_least64_t;
typedef signed char int_fast8_t;
typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
typedef unsigned char uint_fast8_t;
typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
typedef long int intptr_t;
typedef unsigned long int uintptr_t;
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
typedef uint32_t cuuint32_t;
typedef uint64_t cuuint64_t;
typedef unsigned long long CUdeviceptr;
typedef int CUdevice;
typedef struct CUctx_st* CUcontext;
typedef struct CUmod_st* CUmodule;
typedef struct CUfunc_st* CUfunction;
typedef struct CUarray_st* CUarray;
typedef struct CUmipmappedArray_st* CUmipmappedArray;
typedef struct CUtexref_st* CUtexref;
typedef struct CUsurfref_st* CUsurfref;
typedef struct CUevent_st* CUevent;
typedef struct CUstream_st* CUstream;
typedef struct CUgraphicsResource_st* CUgraphicsResource;
typedef unsigned long long CUtexObject;
typedef unsigned long long CUsurfObject;
typedef struct CUextMemory_st* CUexternalMemory;
typedef struct CUextSemaphore_st* CUexternalSemaphore;
typedef struct CUgraph_st* CUgraph;
typedef struct CUgraphNode_st* CUgraphNode;
typedef struct CUgraphExec_st* CUgraphExec;
typedef struct CUuuid_st {
char bytes[16];
} CUuuid;
typedef struct CUipcEventHandle_st {
char reserved[64];
} CUipcEventHandle;
typedef struct CUipcMemHandle_st {
char reserved[64];
} CUipcMemHandle;
typedef enum CUipcMem_flags_enum {
CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 0x1
} CUipcMem_flags;
typedef enum CUmemAttach_flags_enum {
CU_MEM_ATTACH_GLOBAL = 0x1,
CU_MEM_ATTACH_HOST = 0x2,
CU_MEM_ATTACH_SINGLE = 0x4
} CUmemAttach_flags;
typedef enum CUctx_flags_enum {
CU_CTX_SCHED_AUTO = 0x00,
CU_CTX_SCHED_SPIN = 0x01,
CU_CTX_SCHED_YIELD = 0x02,
CU_CTX_SCHED_BLOCKING_SYNC = 0x04,
CU_CTX_BLOCKING_SYNC = 0x04,
CU_CTX_SCHED_MASK = 0x07,
CU_CTX_MAP_HOST = 0x08,
CU_CTX_LMEM_RESIZE_TO_MAX = 0x10,
CU_CTX_FLAGS_MASK = 0x1f
} CUctx_flags;
typedef enum CUstream_flags_enum {
CU_STREAM_DEFAULT = 0x0,
CU_STREAM_NON_BLOCKING = 0x1
} CUstream_flags;
typedef enum CUevent_flags_enum {
CU_EVENT_DEFAULT = 0x0,
CU_EVENT_BLOCKING_SYNC = 0x1,
CU_EVENT_DISABLE_TIMING = 0x2,
CU_EVENT_INTERPROCESS = 0x4
} CUevent_flags;
typedef enum CUstreamWaitValue_flags_enum {
CU_STREAM_WAIT_VALUE_GEQ = 0x0,
CU_STREAM_WAIT_VALUE_EQ = 0x1,
CU_STREAM_WAIT_VALUE_AND = 0x2,
CU_STREAM_WAIT_VALUE_NOR = 0x3,
CU_STREAM_WAIT_VALUE_FLUSH = 1<<30
} CUstreamWaitValue_flags;
typedef enum CUstreamWriteValue_flags_enum {
CU_STREAM_WRITE_VALUE_DEFAULT = 0x0,
CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = 0x1
} CUstreamWriteValue_flags;
typedef enum CUstreamBatchMemOpType_enum {
CU_STREAM_MEM_OP_WAIT_VALUE_32 = 1,
CU_STREAM_MEM_OP_WRITE_VALUE_32 = 2,
CU_STREAM_MEM_OP_WAIT_VALUE_64 = 4,
CU_STREAM_MEM_OP_WRITE_VALUE_64 = 5,
CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = 3
} CUstreamBatchMemOpType;
typedef union CUstreamBatchMemOpParams_union {
CUstreamBatchMemOpType operation;
struct CUstreamMemOpWaitValueParams_st {
CUstreamBatchMemOpType operation;
CUdeviceptr address;
union {
cuuint32_t value;
cuuint64_t value64;
} foo;
unsigned int flags;
CUdeviceptr alias;
} waitValue;
struct CUstreamMemOpWriteValueParams_st {
CUstreamBatchMemOpType operation;
CUdeviceptr address;
union {
cuuint32_t value;
cuuint64_t value64;
} bar;
unsigned int flags;
CUdeviceptr alias;
} writeValue;
struct CUstreamMemOpFlushRemoteWritesParams_st {
CUstreamBatchMemOpType operation;
unsigned int flags;
} flushRemoteWrites;
cuuint64_t pad[6];
} CUstreamBatchMemOpParams;
typedef enum CUoccupancy_flags_enum {
CU_OCCUPANCY_DEFAULT = 0x0,
CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 0x1
} CUoccupancy_flags;
typedef enum CUarray_format_enum {
CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
CU_AD_FORMAT_SIGNED_INT8 = 0x08,
CU_AD_FORMAT_SIGNED_INT16 = 0x09,
CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
CU_AD_FORMAT_HALF = 0x10,
CU_AD_FORMAT_FLOAT = 0x20
} CUarray_format;
typedef enum CUaddress_mode_enum {
CU_TR_ADDRESS_MODE_WRAP = 0,
CU_TR_ADDRESS_MODE_CLAMP = 1,
CU_TR_ADDRESS_MODE_MIRROR = 2,
CU_TR_ADDRESS_MODE_BORDER = 3
} CUaddress_mode;
typedef enum CUfilter_mode_enum {
CU_TR_FILTER_MODE_POINT = 0,
CU_TR_FILTER_MODE_LINEAR = 1
} CUfilter_mode;
typedef enum CUdevice_attribute_enum {
CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1,
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2,
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3,
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4,
CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5,
CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = 6,
CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = 7,
CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = 8,
CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK = 8,
CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY = 9,
CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10,
CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11,
CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = 12,
CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK = 12,
CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13,
CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14,
CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15,
CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16,
CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = 17,
CU_DEVICE_ATTRIBUTE_INTEGRATED = 18,
CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = 19,
CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = 21,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = 22,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = 23,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = 24,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = 25,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = 26,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = 27,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = 28,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = 29,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH = 27,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT = 28,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES = 29,
CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = 30,
CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31,
CU_DEVICE_ATTRIBUTE_ECC_ENABLED = 32,
CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33,
CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34,
CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35,
CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36,
CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = 37,
CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = 38,
CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39,
CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40,
CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = 42,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = 43,
CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER = 44,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = 45,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = 46,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = 47,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = 48,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = 49,
CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50,
CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = 51,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = 52,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = 53,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = 54,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = 55,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = 56,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = 57,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = 58,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = 59,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = 60,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = 61,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = 62,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = 63,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = 64,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = 65,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = 66,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = 67,
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = 68,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = 69,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = 70,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = 71,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = 72,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = 73,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = 74,
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75,
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76,
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = 77,
CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = 78,
CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = 79,
CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED = 80,
CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = 81,
CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = 82,
CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83,
CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84,
CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = 85,
CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = 86,
CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = 87,
CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = 88,
CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = 89,
CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = 90,
CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = 91,
CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS = 92,
CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS = 93,
CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR = 94,
CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH = 95,
CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH = 96,
CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN = 97,
CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES = 98,
CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED = 99,
CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = 100,
CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = 101,
CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED = 102,
CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED = 103,
CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED = 104,
CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED = 105,
CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR = 106,
CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED = 107,
CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE = 108,
CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE = 109,
CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED = 110,
CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK = 111,
CU_DEVICE_ATTRIBUTE_MAX
} CUdevice_attribute;
typedef struct CUdevprop_st {
int maxThreadsPerBlock;
int maxThreadsDim[3];
int maxGridSize[3];
int sharedMemPerBlock;
int totalConstantMemory;
int SIMDWidth;
int memPitch;
int regsPerBlock;
int clockRate;
int textureAlign;
} CUdevprop;
typedef enum CUpointer_attribute_enum {
CU_POINTER_ATTRIBUTE_CONTEXT = 1,
CU_POINTER_ATTRIBUTE_MEMORY_TYPE = 2,
CU_POINTER_ATTRIBUTE_DEVICE_POINTER = 3,
CU_POINTER_ATTRIBUTE_HOST_POINTER = 4,
CU_POINTER_ATTRIBUTE_P2P_TOKENS = 5,
CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = 6,
CU_POINTER_ATTRIBUTE_BUFFER_ID = 7,
CU_POINTER_ATTRIBUTE_IS_MANAGED = 8,
CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL = 9,
CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE = 10,
CU_POINTER_ATTRIBUTE_RANGE_START_ADDR = 11,
CU_POINTER_ATTRIBUTE_RANGE_SIZE = 12,
CU_POINTER_ATTRIBUTE_MAPPED = 13,
CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES = 14,
CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE = 15
} CUpointer_attribute;
typedef enum CUfunction_attribute_enum {
CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0,
CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = 1,
CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES = 2,
CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES = 3,
CU_FUNC_ATTRIBUTE_NUM_REGS = 4,
CU_FUNC_ATTRIBUTE_PTX_VERSION = 5,
CU_FUNC_ATTRIBUTE_BINARY_VERSION = 6,
CU_FUNC_ATTRIBUTE_CACHE_MODE_CA = 7,
CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = 8,
CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 9,
CU_FUNC_ATTRIBUTE_MAX
} CUfunction_attribute;
typedef enum CUfunc_cache_enum {
CU_FUNC_CACHE_PREFER_NONE = 0x00,
CU_FUNC_CACHE_PREFER_SHARED = 0x01,
CU_FUNC_CACHE_PREFER_L1 = 0x02,
CU_FUNC_CACHE_PREFER_EQUAL = 0x03
} CUfunc_cache;
typedef enum CUsharedconfig_enum {
CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = 0x00,
CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = 0x01,
CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = 0x02
} CUsharedconfig;
typedef enum CUshared_carveout_enum {
CU_SHAREDMEM_CARVEOUT_DEFAULT = -1,
CU_SHAREDMEM_CARVEOUT_MAX_SHARED = 100,
CU_SHAREDMEM_CARVEOUT_MAX_L1 = 0
} CUshared_carveout;
typedef enum CUmemorytype_enum {
CU_MEMORYTYPE_HOST = 0x01,
CU_MEMORYTYPE_DEVICE = 0x02,
CU_MEMORYTYPE_ARRAY = 0x03,
CU_MEMORYTYPE_UNIFIED = 0x04
} CUmemorytype;
typedef enum CUcomputemode_enum {
CU_COMPUTEMODE_DEFAULT = 0,
CU_COMPUTEMODE_PROHIBITED = 2,
CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3
} CUcomputemode;
typedef enum CUmem_advise_enum {
CU_MEM_ADVISE_SET_READ_MOSTLY = 1,
CU_MEM_ADVISE_UNSET_READ_MOSTLY = 2,
CU_MEM_ADVISE_SET_PREFERRED_LOCATION = 3,
CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = 4,
CU_MEM_ADVISE_SET_ACCESSED_BY = 5,
CU_MEM_ADVISE_UNSET_ACCESSED_BY = 6
} CUmem_advise;
typedef enum CUmem_range_attribute_enum {
CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1,
CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = 2,
CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY = 3,
CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION = 4
} CUmem_range_attribute;
typedef enum CUjit_option_enum {
CU_JIT_MAX_REGISTERS = 0,
CU_JIT_THREADS_PER_BLOCK,
CU_JIT_WALL_TIME,
CU_JIT_INFO_LOG_BUFFER,
CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES,
CU_JIT_ERROR_LOG_BUFFER,
CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES,
CU_JIT_OPTIMIZATION_LEVEL,
CU_JIT_TARGET_FROM_CUCONTEXT,
CU_JIT_TARGET,
CU_JIT_FALLBACK_STRATEGY,
CU_JIT_GENERATE_DEBUG_INFO,
CU_JIT_LOG_VERBOSE,
CU_JIT_GENERATE_LINE_INFO,
CU_JIT_CACHE_MODE,
CU_JIT_NEW_SM3X_OPT,
CU_JIT_FAST_COMPILE,
CU_JIT_GLOBAL_SYMBOL_NAMES,
CU_JIT_GLOBAL_SYMBOL_ADDRESSES,
CU_JIT_GLOBAL_SYMBOL_COUNT,
CU_JIT_NUM_OPTIONS
} CUjit_option;
typedef enum CUjit_target_enum {
CU_TARGET_COMPUTE_20 = 20,
CU_TARGET_COMPUTE_21 = 21,
CU_TARGET_COMPUTE_30 = 30,
CU_TARGET_COMPUTE_32 = 32,
CU_TARGET_COMPUTE_35 = 35,
CU_TARGET_COMPUTE_37 = 37,
CU_TARGET_COMPUTE_50 = 50,
CU_TARGET_COMPUTE_52 = 52,
CU_TARGET_COMPUTE_53 = 53,
CU_TARGET_COMPUTE_60 = 60,
CU_TARGET_COMPUTE_61 = 61,
CU_TARGET_COMPUTE_62 = 62,
CU_TARGET_COMPUTE_70 = 70,
CU_TARGET_COMPUTE_72 = 72,
CU_TARGET_COMPUTE_75 = 75,
CU_TARGET_COMPUTE_80 = 80
} CUjit_target;
typedef enum CUjit_fallback_enum {
CU_PREFER_PTX = 0,
CU_PREFER_BINARY
} CUjit_fallback;
typedef enum CUjit_cacheMode_enum {
CU_JIT_CACHE_OPTION_NONE = 0,
CU_JIT_CACHE_OPTION_CG,
CU_JIT_CACHE_OPTION_CA
} CUjit_cacheMode;
typedef enum CUjitInputType_enum {
CU_JIT_INPUT_CUBIN = 0,
CU_JIT_INPUT_PTX,
CU_JIT_INPUT_FATBINARY,
CU_JIT_INPUT_OBJECT,
CU_JIT_INPUT_LIBRARY,
CU_JIT_NUM_INPUT_TYPES
} CUjitInputType;
typedef struct CUlinkState_st* CUlinkState;
typedef enum CUgraphicsRegisterFlags_enum {
CU_GRAPHICS_REGISTER_FLAGS_NONE = 0x00,
CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = 0x01,
CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = 0x02,
CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = 0x04,
CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 0x08
} CUgraphicsRegisterFlags;
typedef enum CUgraphicsMapResourceFlags_enum {
CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0x00,
CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 0x01,
CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02
} CUgraphicsMapResourceFlags;
typedef enum CUarray_cubemap_face_enum {
CU_CUBEMAP_FACE_POSITIVE_X = 0x00,
CU_CUBEMAP_FACE_NEGATIVE_X = 0x01,
CU_CUBEMAP_FACE_POSITIVE_Y = 0x02,
CU_CUBEMAP_FACE_NEGATIVE_Y = 0x03,
CU_CUBEMAP_FACE_POSITIVE_Z = 0x04,
CU_CUBEMAP_FACE_NEGATIVE_Z = 0x05
} CUarray_cubemap_face;
typedef enum CUlimit_enum {
CU_LIMIT_STACK_SIZE = 0x00,
CU_LIMIT_PRINTF_FIFO_SIZE = 0x01,
CU_LIMIT_MALLOC_HEAP_SIZE = 0x02,
CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 0x03,
CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 0x04,
CU_LIMIT_MAX_L2_FETCH_GRANULARITY = 0x05,
CU_LIMIT_PERSISTING_L2_CACHE_SIZE = 0x06,
CU_LIMIT_MAX
} CUlimit;
typedef enum CUresourcetype_enum {
CU_RESOURCE_TYPE_ARRAY = 0x00,
CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01,
CU_RESOURCE_TYPE_LINEAR = 0x02,
CU_RESOURCE_TYPE_PITCH2D = 0x03
} CUresourcetype;
typedef void ( *CUhostFn)(void* userData);
typedef enum CUaccessProperty_enum {
CU_ACCESS_PROPERTY_NORMAL = 0,
CU_ACCESS_PROPERTY_STREAMING = 1,
CU_ACCESS_PROPERTY_PERSISTING = 2
} CUaccessProperty;
typedef struct CUaccessPolicyWindow_st {
void* base_ptr;
size_t num_bytes;
float hitRatio;
CUaccessProperty hitProp;
CUaccessProperty missProp;
} CUaccessPolicyWindow;
typedef struct CUDA_KERNEL_NODE_PARAMS_st {
CUfunction func;
unsigned int gridDimX;
unsigned int gridDimY;
unsigned int gridDimZ;
unsigned int blockDimX;
unsigned int blockDimY;
unsigned int blockDimZ;
unsigned int sharedMemBytes;
void** kernelParams;
void** extra;
} CUDA_KERNEL_NODE_PARAMS;
typedef struct CUDA_MEMSET_NODE_PARAMS_st {
CUdeviceptr dst;
size_t pitch;
unsigned int value;
unsigned int elementSize;
size_t width;
size_t height;
} CUDA_MEMSET_NODE_PARAMS;
typedef struct CUDA_HOST_NODE_PARAMS_st {
CUhostFn fn;
void* userData;
} CUDA_HOST_NODE_PARAMS;
typedef enum CUgraphNodeType_enum {
CU_GRAPH_NODE_TYPE_KERNEL = 0,
CU_GRAPH_NODE_TYPE_MEMCPY = 1,
CU_GRAPH_NODE_TYPE_MEMSET = 2,
CU_GRAPH_NODE_TYPE_HOST = 3,
CU_GRAPH_NODE_TYPE_GRAPH = 4,
CU_GRAPH_NODE_TYPE_EMPTY = 5
} CUgraphNodeType;
typedef enum CUsynchronizationPolicy_enum {
CU_SYNC_POLICY_AUTO = 1,
CU_SYNC_POLICY_SPIN = 2,
CU_SYNC_POLICY_YIELD = 3,
CU_SYNC_POLICY_BLOCKING_SYNC = 4
} CUsynchronizationPolicy;
typedef enum CUkernelNodeAttrID_enum {
CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1,
CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2
} CUkernelNodeAttrID;
typedef union CUkernelNodeAttrValue_union {
CUaccessPolicyWindow accessPolicyWindow;
int cooperative;
} CUkernelNodeAttrValue;
typedef enum CUstreamCaptureStatus_enum {
CU_STREAM_CAPTURE_STATUS_NONE = 0,
CU_STREAM_CAPTURE_STATUS_ACTIVE = 1,
CU_STREAM_CAPTURE_STATUS_INVALIDATED = 2
} CUstreamCaptureStatus;
typedef enum CUstreamCaptureMode_enum {
CU_STREAM_CAPTURE_MODE_GLOBAL = 0,
CU_STREAM_CAPTURE_MODE_THREAD_LOCAL = 1,
CU_STREAM_CAPTURE_MODE_RELAXED = 2
} CUstreamCaptureMode;
typedef enum CUstreamAttrID_enum {
CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1,
CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3
} CUstreamAttrID;
typedef union CUstreamAttrValue_union {
CUaccessPolicyWindow accessPolicyWindow;
CUsynchronizationPolicy syncPolicy;
} CUstreamAttrValue;
typedef enum cudaError_enum {
CUDA_SUCCESS = 0,
CUDA_ERROR_INVALID_VALUE = 1,
CUDA_ERROR_OUT_OF_MEMORY = 2,
CUDA_ERROR_NOT_INITIALIZED = 3,
CUDA_ERROR_DEINITIALIZED = 4,
CUDA_ERROR_PROFILER_DISABLED = 5,
CUDA_ERROR_PROFILER_NOT_INITIALIZED = 6,
CUDA_ERROR_PROFILER_ALREADY_STARTED = 7,
CUDA_ERROR_PROFILER_ALREADY_STOPPED = 8,
CUDA_ERROR_NO_DEVICE = 100,
CUDA_ERROR_INVALID_DEVICE = 101,
CUDA_ERROR_INVALID_IMAGE = 200,
CUDA_ERROR_INVALID_CONTEXT = 201,
CUDA_ERROR_CONTEXT_ALREADY_CURRENT = 202,
CUDA_ERROR_MAP_FAILED = 205,
CUDA_ERROR_UNMAP_FAILED = 206,
CUDA_ERROR_ARRAY_IS_MAPPED = 207,
CUDA_ERROR_ALREADY_MAPPED = 208,
CUDA_ERROR_NO_BINARY_FOR_GPU = 209,
CUDA_ERROR_ALREADY_ACQUIRED = 210,
CUDA_ERROR_NOT_MAPPED = 211,
CUDA_ERROR_NOT_MAPPED_AS_ARRAY = 212,
CUDA_ERROR_NOT_MAPPED_AS_POINTER = 213,
CUDA_ERROR_ECC_UNCORRECTABLE = 214,
CUDA_ERROR_UNSUPPORTED_LIMIT = 215,
CUDA_ERROR_CONTEXT_ALREADY_IN_USE = 216,
CUDA_ERROR_PEER_ACCESS_UNSUPPORTED = 217,
CUDA_ERROR_INVALID_PTX = 218,
CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 219,
CUDA_ERROR_NVLINK_UNCORRECTABLE = 220,
CUDA_ERROR_JIT_COMPILER_NOT_FOUND = 221,
CUDA_ERROR_INVALID_SOURCE = 300,
CUDA_ERROR_FILE_NOT_FOUND = 301,
CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 302,
CUDA_ERROR_SHARED_OBJECT_INIT_FAILED = 303,
CUDA_ERROR_OPERATING_SYSTEM = 304,
CUDA_ERROR_INVALID_HANDLE = 400,
CUDA_ERROR_ILLEGAL_STATE = 401,
CUDA_ERROR_NOT_FOUND = 500,
CUDA_ERROR_NOT_READY = 600,
CUDA_ERROR_ILLEGAL_ADDRESS = 700,
CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = 701,
CUDA_ERROR_LAUNCH_TIMEOUT = 702,
CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING = 703,
CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED = 704,
CUDA_ERROR_PEER_ACCESS_NOT_ENABLED = 705,
CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = 708,
CUDA_ERROR_CONTEXT_IS_DESTROYED = 709,
CUDA_ERROR_ASSERT = 710,
CUDA_ERROR_TOO_MANY_PEERS = 711,
CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED = 712,
CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED = 713,
CUDA_ERROR_HARDWARE_STACK_ERROR = 714,
CUDA_ERROR_ILLEGAL_INSTRUCTION = 715,
CUDA_ERROR_MISALIGNED_ADDRESS = 716,
CUDA_ERROR_INVALID_ADDRESS_SPACE = 717,
CUDA_ERROR_INVALID_PC = 718,
CUDA_ERROR_LAUNCH_FAILED = 719,
CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE = 720,
CUDA_ERROR_NOT_PERMITTED = 800,
CUDA_ERROR_NOT_SUPPORTED = 801,
CUDA_ERROR_SYSTEM_NOT_READY = 802,
CUDA_ERROR_SYSTEM_DRIVER_MISMATCH = 803,
CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE = 804,
CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED = 900,
CUDA_ERROR_STREAM_CAPTURE_INVALIDATED = 901,
CUDA_ERROR_STREAM_CAPTURE_MERGE = 902,
CUDA_ERROR_STREAM_CAPTURE_UNMATCHED = 903,
CUDA_ERROR_STREAM_CAPTURE_UNJOINED = 904,
CUDA_ERROR_STREAM_CAPTURE_ISOLATION = 905,
CUDA_ERROR_STREAM_CAPTURE_IMPLICIT = 906,
CUDA_ERROR_CAPTURED_EVENT = 907,
CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD = 908,
CUDA_ERROR_TIMEOUT = 909,
CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE = 910,
CUDA_ERROR_UNKNOWN = 999
} CUresult;
typedef enum CUdevice_P2PAttribute_enum {
CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 0x01,
CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = 0x02,
CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = 0x03,
CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED = 0x04,
CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED = 0x04
} CUdevice_P2PAttribute;
typedef void ( *CUstreamCallback)(CUstream hStream, CUresult status, void* userData);
typedef size_t ( *CUoccupancyB2DSize)(int blockSize);
typedef struct CUDA_MEMCPY2D_st {
size_t srcXInBytes;
size_t srcY;
CUmemorytype srcMemoryType;
const void* srcHost;
CUdeviceptr srcDevice;
CUarray srcArray;
size_t srcPitch;
size_t dstXInBytes;
size_t dstY;
CUmemorytype dstMemoryType;
void* dstHost;
CUdeviceptr dstDevice;
CUarray dstArray;
size_t dstPitch;
size_t WidthInBytes;
size_t Height;
} CUDA_MEMCPY2D;
typedef struct CUDA_MEMCPY3D_st {
size_t srcXInBytes;
size_t srcY;
size_t srcZ;
size_t srcLOD;
CUmemorytype srcMemoryType;
const void* srcHost;
CUdeviceptr srcDevice;
CUarray srcArray;
void* reserved0;
size_t srcPitch;
size_t srcHeight;
size_t dstXInBytes;
size_t dstY;
size_t dstZ;
size_t dstLOD;
CUmemorytype dstMemoryType;
void* dstHost;
CUdeviceptr dstDevice;
CUarray dstArray;
void* reserved1;
size_t dstPitch;
size_t dstHeight;
size_t WidthInBytes;
size_t Height;
size_t Depth;
} CUDA_MEMCPY3D;
typedef struct CUDA_MEMCPY3D_PEER_st {
size_t srcXInBytes;
size_t srcY;
size_t srcZ;
size_t srcLOD;
CUmemorytype srcMemoryType;
const void* srcHost;
CUdeviceptr srcDevice;
CUarray srcArray;
CUcontext srcContext;
size_t srcPitch;
size_t srcHeight;
size_t dstXInBytes;
size_t dstY;
size_t dstZ;
size_t dstLOD;
CUmemorytype dstMemoryType;
void* dstHost;
CUdeviceptr dstDevice;
CUarray dstArray;
CUcontext dstContext;
size_t dstPitch;
size_t dstHeight;
size_t WidthInBytes;
size_t Height;
size_t Depth;
} CUDA_MEMCPY3D_PEER;
typedef struct CUDA_ARRAY_DESCRIPTOR_st {
size_t Width;
size_t Height;
CUarray_format Format;
unsigned int NumChannels;
} CUDA_ARRAY_DESCRIPTOR;
typedef struct CUDA_ARRAY3D_DESCRIPTOR_st {
size_t Width;
size_t Height;
size_t Depth;
CUarray_format Format;
unsigned int NumChannels;
unsigned int Flags;
} CUDA_ARRAY3D_DESCRIPTOR;
typedef struct CUDA_RESOURCE_DESC_st {
CUresourcetype resType;
union {
struct {
CUarray hArray;
} array;
struct {
CUmipmappedArray hMipmappedArray;
} mipmap;
struct {
CUdeviceptr devPtr;
CUarray_format format;
unsigned int numChannels;
size_t sizeInBytes;
} linear;
struct {
CUdeviceptr devPtr;
CUarray_format format;
unsigned int numChannels;
size_t width;
size_t height;
size_t pitchInBytes;
} pitch2D;
struct {
int reserved[32];
} reserved;
} res;
unsigned int flags;
} CUDA_RESOURCE_DESC;
typedef struct CUDA_TEXTURE_DESC_st {
CUaddress_mode addressMode[3];
CUfilter_mode filterMode;
unsigned int flags;
unsigned int maxAnisotropy;
CUfilter_mode mipmapFilterMode;
float mipmapLevelBias;
float minMipmapLevelClamp;
float maxMipmapLevelClamp;
float borderColor[4];
int reserved[12];
} CUDA_TEXTURE_DESC;
typedef enum CUresourceViewFormat_enum {
CU_RES_VIEW_FORMAT_NONE = 0x00,
CU_RES_VIEW_FORMAT_UINT_1X8 = 0x01,
CU_RES_VIEW_FORMAT_UINT_2X8 = 0x02,
CU_RES_VIEW_FORMAT_UINT_4X8 = 0x03,
CU_RES_VIEW_FORMAT_SINT_1X8 = 0x04,
CU_RES_VIEW_FORMAT_SINT_2X8 = 0x05,
CU_RES_VIEW_FORMAT_SINT_4X8 = 0x06,
CU_RES_VIEW_FORMAT_UINT_1X16 = 0x07,
CU_RES_VIEW_FORMAT_UINT_2X16 = 0x08,
CU_RES_VIEW_FORMAT_UINT_4X16 = 0x09,
CU_RES_VIEW_FORMAT_SINT_1X16 = 0x0a,
CU_RES_VIEW_FORMAT_SINT_2X16 = 0x0b,
CU_RES_VIEW_FORMAT_SINT_4X16 = 0x0c,
CU_RES_VIEW_FORMAT_UINT_1X32 = 0x0d,
CU_RES_VIEW_FORMAT_UINT_2X32 = 0x0e,
CU_RES_VIEW_FORMAT_UINT_4X32 = 0x0f,
CU_RES_VIEW_FORMAT_SINT_1X32 = 0x10,
CU_RES_VIEW_FORMAT_SINT_2X32 = 0x11,
CU_RES_VIEW_FORMAT_SINT_4X32 = 0x12,
CU_RES_VIEW_FORMAT_FLOAT_1X16 = 0x13,
CU_RES_VIEW_FORMAT_FLOAT_2X16 = 0x14,
CU_RES_VIEW_FORMAT_FLOAT_4X16 = 0x15,
CU_RES_VIEW_FORMAT_FLOAT_1X32 = 0x16,
CU_RES_VIEW_FORMAT_FLOAT_2X32 = 0x17,
CU_RES_VIEW_FORMAT_FLOAT_4X32 = 0x18,
CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = 0x19,
CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = 0x1a,
CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = 0x1b,
CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = 0x1c,
CU_RES_VIEW_FORMAT_SIGNED_BC4 = 0x1d,
CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = 0x1e,
CU_RES_VIEW_FORMAT_SIGNED_BC5 = 0x1f,
CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = 0x20,
CU_RES_VIEW_FORMAT_SIGNED_BC6H = 0x21,
CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22
} CUresourceViewFormat;
typedef struct CUDA_RESOURCE_VIEW_DESC_st {
CUresourceViewFormat format;
size_t width;
size_t height;
size_t depth;
unsigned int firstMipmapLevel;
unsigned int lastMipmapLevel;
unsigned int firstLayer;
unsigned int lastLayer;
unsigned int reserved[16];
} CUDA_RESOURCE_VIEW_DESC;
typedef struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st {
unsigned long long p2pToken;
unsigned int vaSpaceToken;
} CUDA_POINTER_ATTRIBUTE_P2P_TOKENS;
typedef struct CUDA_LAUNCH_PARAMS_st {
CUfunction function;
unsigned int gridDimX;
unsigned int gridDimY;
unsigned int gridDimZ;
unsigned int blockDimX;
unsigned int blockDimY;
unsigned int blockDimZ;
unsigned int sharedMemBytes;
CUstream hStream;
void** kernelParams;
} CUDA_LAUNCH_PARAMS;
typedef enum CUexternalMemoryHandleType_enum {
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = 1,
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 = 2,
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3,
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP = 4,
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE = 5,
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE = 6,
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT = 7,
CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = 8
} CUexternalMemoryHandleType;
typedef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st {
CUexternalMemoryHandleType type;
union {
int fd;
struct {
void* handle;
const void* name;
} win32;
const void* nvSciBufObject;
} handle;
unsigned long long size;
unsigned int flags;
unsigned int reserved[16];
} CUDA_EXTERNAL_MEMORY_HANDLE_DESC;
typedef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st {
unsigned long long offset;
unsigned long long size;
unsigned int flags;
unsigned int reserved[16];
} CUDA_EXTERNAL_MEMORY_BUFFER_DESC;
typedef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st {
unsigned long long offset;
CUDA_ARRAY3D_DESCRIPTOR arrayDesc;
unsigned int numLevels;
unsigned int reserved[16];
} CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC;
typedef enum CUexternalSemaphoreHandleType_enum {
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = 1,
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 = 2,
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3,
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE = 4,
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE = 5,
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC = 6,
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX = 7,
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT = 8
} CUexternalSemaphoreHandleType;
typedef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st {
CUexternalSemaphoreHandleType type;
union {
int fd;
struct {
void* handle;
const void* name;
} win32;
const void* nvSciSyncObj;
} handle;
unsigned int flags;
unsigned int reserved[16];
} CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC;
typedef struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st {
struct {
struct {
unsigned long long value;
} fence;
union {
void* fence;
unsigned long long reserved;
} nvSciSync;
struct {
unsigned long long key;
} keyedMutex;
unsigned int reserved[12];
} params;
unsigned int flags;
unsigned int reserved[16];
} CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS;
typedef struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st {
struct {
struct {
unsigned long long value;
} fence;
union {
void* fence;
unsigned long long reserved;
} nvSciSync;
struct {
unsigned long long key;
unsigned int timeoutMs;
} keyedMutex;
unsigned int reserved[10];
} params;
unsigned int flags;
unsigned int reserved[16];
} CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS;
typedef unsigned long long CUmemGenericAllocationHandle;
typedef enum CUmemAllocationHandleType_enum {
CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 0x1,
CU_MEM_HANDLE_TYPE_WIN32 = 0x2,
CU_MEM_HANDLE_TYPE_WIN32_KMT = 0x4,
CU_MEM_HANDLE_TYPE_MAX = 0xFFFFFFFF
} CUmemAllocationHandleType;
typedef enum CUmemAccess_flags_enum {
CU_MEM_ACCESS_FLAGS_PROT_NONE = 0x0,
CU_MEM_ACCESS_FLAGS_PROT_READ = 0x1,
CU_MEM_ACCESS_FLAGS_PROT_READWRITE = 0x3,
CU_MEM_ACCESS_FLAGS_PROT_MAX = 0xFFFFFFFF
} CUmemAccess_flags;
typedef enum CUmemLocationType_enum {
CU_MEM_LOCATION_TYPE_INVALID = 0x0,
CU_MEM_LOCATION_TYPE_DEVICE = 0x1,
CU_MEM_LOCATION_TYPE_MAX = 0xFFFFFFFF
} CUmemLocationType;
typedef enum CUmemAllocationType_enum {
CU_MEM_ALLOCATION_TYPE_INVALID = 0x0,
CU_MEM_ALLOCATION_TYPE_PINNED = 0x1,
CU_MEM_ALLOCATION_TYPE_MAX = 0xFFFFFFFF
} CUmemAllocationType;
typedef enum CUmemAllocationGranularity_flags_enum {
CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0x0,
CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 0x1
} CUmemAllocationGranularity_flags;
typedef struct CUmemLocation_st {
CUmemLocationType type;
int id;
} CUmemLocation;
typedef enum CUmemAllocationCompType_enum {
CU_MEM_ALLOCATION_COMP_NONE = 0x0,
CU_MEM_ALLOCATION_COMP_GENERIC = 0x1
} CUmemAllocationCompType;
typedef struct CUmemAllocationProp_st {
CUmemAllocationType type;
CUmemAllocationHandleType requestedHandleTypes;
CUmemLocation location;
void* win32HandleMetaData;
struct {
unsigned char compressionType;
unsigned char gpuDirectRDMACapable;
unsigned char reserved[6];
} allocFlags;
} CUmemAllocationProp;
typedef struct CUmemAccessDesc_st {
CUmemLocation location;
CUmemAccess_flags flags;
} CUmemAccessDesc;
typedef enum CUgraphExecUpdateResult_enum {
CU_GRAPH_EXEC_UPDATE_SUCCESS = 0x0,
CU_GRAPH_EXEC_UPDATE_ERROR = 0x1,
CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED = 0x2,
CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED = 0x3,
CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED = 0x4,
CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED = 0x5,
CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED = 0x6
} CUgraphExecUpdateResult;
CUresult cuGetErrorString(CUresult error, const char** pStr);
CUresult cuGetErrorName(CUresult error, const char** pStr);
CUresult cuInit(unsigned int Flags);
CUresult cuDriverGetVersion(int* driverVersion);
CUresult cuDeviceGet(CUdevice* device, int ordinal);
CUresult cuDeviceGetCount(int* count);
CUresult cuDeviceGetName(char* name, int len, CUdevice dev);
CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev);
CUresult cuDeviceTotalMem(size_t* bytes, CUdevice dev);
CUresult cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev);
CUresult cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags);
__attribute__((deprecated)) CUresult cuDeviceGetProperties(CUdevprop* prop, CUdevice dev);
__attribute__((deprecated)) CUresult cuDeviceComputeCapability(int* major, int* minor, CUdevice dev);
CUresult cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev);
CUresult cuDevicePrimaryCtxRelease(CUdevice dev);
CUresult cuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned int flags);
CUresult cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active);
CUresult cuDevicePrimaryCtxReset(CUdevice dev);
CUresult cuCtxCreate(CUcontext* pctx, unsigned int flags, CUdevice dev);
CUresult cuCtxDestroy(CUcontext ctx);
CUresult cuCtxPushCurrent(CUcontext ctx);
CUresult cuCtxPopCurrent(CUcontext* pctx);
CUresult cuCtxSetCurrent(CUcontext ctx);
CUresult cuCtxGetCurrent(CUcontext* pctx);
CUresult cuCtxGetDevice(CUdevice* device);
CUresult cuCtxGetFlags(unsigned int* flags);
CUresult cuCtxSynchronize(void);
CUresult cuCtxSetLimit(CUlimit limit, size_t value);
CUresult cuCtxGetLimit(size_t* pvalue, CUlimit limit);
CUresult cuCtxGetCacheConfig(CUfunc_cache* pconfig);
CUresult cuCtxSetCacheConfig(CUfunc_cache config);
CUresult cuCtxGetSharedMemConfig(CUsharedconfig* pConfig);
CUresult cuCtxSetSharedMemConfig(CUsharedconfig config);
CUresult cuCtxGetApiVersion(CUcontext ctx, unsigned int* version);
CUresult cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
CUresult cuCtxResetPersistingL2Cache(void);
__attribute__((deprecated)) CUresult cuCtxAttach(CUcontext* pctx, unsigned int flags);
__attribute__((deprecated)) CUresult cuCtxDetach(CUcontext ctx);
CUresult cuModuleLoad(CUmodule* module, const char* fname);
CUresult cuModuleLoadData(CUmodule* module, const void* image);
CUresult cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues);
CUresult cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin);
CUresult cuModuleUnload(CUmodule hmod);
CUresult cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name);
CUresult cuModuleGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name);
CUresult cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name);
CUresult cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name);
CUresult
cuLinkCreate(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut);
CUresult
cuLinkAddData(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name,
unsigned int numOptions, CUjit_option* options, void** optionValues);
CUresult
cuLinkAddFile(CUlinkState state, CUjitInputType type, const char* path,
unsigned int numOptions, CUjit_option* options, void** optionValues);
CUresult
cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut);
CUresult
cuLinkDestroy(CUlinkState state);
CUresult cuMemGetInfo(size_t* free, size_t* total);
CUresult cuMemAlloc(CUdeviceptr* dptr, size_t bytesize);
CUresult cuMemAllocPitch(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes);
CUresult cuMemFree(CUdeviceptr dptr);
CUresult cuMemGetAddressRange(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr);
CUresult cuMemAllocHost(void** pp, size_t bytesize);
CUresult cuMemFreeHost(void* p);
CUresult cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags);
CUresult cuMemHostGetDevicePointer(CUdeviceptr* pdptr, void* p, unsigned int Flags);
CUresult cuMemHostGetFlags(unsigned int* pFlags, void* p);
CUresult cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags);
CUresult cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId);
CUresult cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev);
CUresult cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event);
CUresult cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle);
CUresult cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr);
CUresult cuIpcOpenMemHandle(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags);
CUresult cuIpcCloseMemHandle(CUdeviceptr dptr);
CUresult cuMemHostRegister(void* p, size_t bytesize, unsigned int Flags);
CUresult cuMemHostUnregister(void* p);
CUresult cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount);
CUresult cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount);
CUresult cuMemcpyHtoD(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount);
CUresult cuMemcpyDtoH(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount);
CUresult cuMemcpyDtoD(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount);
CUresult cuMemcpyDtoA(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount);
CUresult cuMemcpyAtoD(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount);
CUresult cuMemcpyHtoA(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount);
CUresult cuMemcpyAtoH(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount);
CUresult cuMemcpyAtoA(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount);
CUresult cuMemcpy2D(const CUDA_MEMCPY2D* pCopy);
CUresult cuMemcpy2DUnaligned(const CUDA_MEMCPY2D* pCopy);
CUresult cuMemcpy3D(const CUDA_MEMCPY3D* pCopy);
CUresult cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy);
CUresult cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream);
CUresult cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream);
CUresult cuMemcpyHtoDAsync(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream);
CUresult cuMemcpyDtoHAsync(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
CUresult cuMemcpyDtoDAsync(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
CUresult cuMemcpyHtoAAsync(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream);
CUresult cuMemcpyAtoHAsync(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream);
CUresult cuMemcpy2DAsync(const CUDA_MEMCPY2D* pCopy, CUstream hStream);
CUresult cuMemcpy3DAsync(const CUDA_MEMCPY3D* pCopy, CUstream hStream);
CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream);
CUresult cuMemsetD8(CUdeviceptr dstDevice, unsigned char uc, size_t N);
CUresult cuMemsetD16(CUdeviceptr dstDevice, unsigned short us, size_t N);
CUresult cuMemsetD32(CUdeviceptr dstDevice, unsigned int ui, size_t N);
CUresult cuMemsetD2D8(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height);
CUresult cuMemsetD2D16(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height);
CUresult cuMemsetD2D32(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height);
CUresult cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream);
CUresult cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream);
CUresult cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream);
CUresult cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream);
CUresult cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream);
CUresult cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream);
CUresult cuArrayCreate(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray);
CUresult cuArrayGetDescriptor(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray);
CUresult cuArrayDestroy(CUarray hArray);
CUresult cuArray3DCreate(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray);
CUresult cuArray3DGetDescriptor(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray);
CUresult cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels);
CUresult cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level);
CUresult cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray);
CUresult cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags);
CUresult cuMemAddressFree(CUdeviceptr ptr, size_t size);
CUresult cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags);
CUresult cuMemRelease(CUmemGenericAllocationHandle handle);
CUresult cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags);
CUresult cuMemUnmap(CUdeviceptr ptr, size_t size);
CUresult cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count);
CUresult cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr);
CUresult cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags);
CUresult cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType);
CUresult cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option);
CUresult cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle);
CUresult cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr);
CUresult cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr);
CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream);
CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device);
CUresult cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count);
CUresult cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count);
CUresult cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr);
CUresult cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr);
CUresult cuStreamCreate(CUstream* phStream, unsigned int Flags);
CUresult cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority);
CUresult cuStreamGetPriority(CUstream hStream, int* priority);
CUresult cuStreamGetFlags(CUstream hStream, unsigned int* flags);
CUresult cuStreamGetCtx(CUstream hStream, CUcontext* pctx);
CUresult cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags);
CUresult cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags);
CUresult cuStreamBeginCapture(CUstream hStream, CUstreamCaptureMode mode);
CUresult cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode);
CUresult cuStreamEndCapture(CUstream hStream, CUgraph* phGraph);
CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus);
CUresult cuStreamGetCaptureInfo(CUstream hStream, CUstreamCaptureStatus* captureStatus, cuuint64_t* id);
CUresult cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags);
CUresult cuStreamQuery(CUstream hStream);
CUresult cuStreamSynchronize(CUstream hStream);
CUresult cuStreamDestroy(CUstream hStream);
CUresult cuStreamCopyAttributes(CUstream dst, CUstream src);
CUresult cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr,
CUstreamAttrValue* value_out);
CUresult cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr,
const CUstreamAttrValue* value);
CUresult cuEventCreate(CUevent* phEvent, unsigned int Flags);
CUresult cuEventRecord(CUevent hEvent, CUstream hStream);
CUresult cuEventQuery(CUevent hEvent);
CUresult cuEventSynchronize(CUevent hEvent);
CUresult cuEventDestroy(CUevent hEvent);
CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd);
CUresult cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc);
CUresult cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc);
CUresult cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc);
CUresult cuDestroyExternalMemory(CUexternalMemory extMem);
CUresult cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc);
CUresult cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream);
CUresult cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream);
CUresult cuDestroyExternalSemaphore(CUexternalSemaphore extSem);
CUresult cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags);
CUresult cuStreamWaitValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags);
CUresult cuStreamWriteValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags);
CUresult cuStreamWriteValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags);
CUresult cuStreamBatchMemOp(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags);
CUresult cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc);
CUresult cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value);
CUresult cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config);
CUresult cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config);
CUresult cuLaunchKernel(CUfunction f,
unsigned int gridDimX,
unsigned int gridDimY,
unsigned int gridDimZ,
unsigned int blockDimX,
unsigned int blockDimY,
unsigned int blockDimZ,
unsigned int sharedMemBytes,
CUstream hStream,
void** kernelParams,
void** extra);
CUresult cuLaunchCooperativeKernel(CUfunction f,
unsigned int gridDimX,
unsigned int gridDimY,
unsigned int gridDimZ,
unsigned int blockDimX,
unsigned int blockDimY,
unsigned int blockDimZ,
unsigned int sharedMemBytes,
CUstream hStream,
void** kernelParams);
CUresult cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags);
CUresult cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData);
__attribute__((deprecated)) CUresult cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z);
__attribute__((deprecated)) CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes);
__attribute__((deprecated)) CUresult cuParamSetSize(CUfunction hfunc, unsigned int numbytes);
__attribute__((deprecated)) CUresult cuParamSeti(CUfunction hfunc, int offset, unsigned int value);
__attribute__((deprecated)) CUresult cuParamSetf(CUfunction hfunc, int offset, float value);
__attribute__((deprecated)) CUresult cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes);
__attribute__((deprecated)) CUresult cuLaunch(CUfunction f);
__attribute__((deprecated)) CUresult cuLaunchGrid(CUfunction f, int grid_width, int grid_height);
__attribute__((deprecated)) CUresult cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream);
__attribute__((deprecated)) CUresult cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef);
CUresult cuGraphCreate(CUgraph* phGraph, unsigned int flags);
CUresult cuGraphAddKernelNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams);
CUresult cuGraphKernelNodeGetParams(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams);
CUresult cuGraphKernelNodeSetParams(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams);
CUresult cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx);
CUresult cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams);
CUresult cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams);
CUresult cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx);
CUresult cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams);
CUresult cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams);
CUresult cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams);
CUresult cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams);
CUresult cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams);
CUresult cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph);
CUresult cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph);
CUresult cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies);
CUresult cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph);
CUresult cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph);
CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type);
CUresult cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes);
CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes);
CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from, CUgraphNode* to, size_t* numEdges);
CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, size_t* numDependencies);
CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, size_t* numDependentNodes);
CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from, const CUgraphNode* to, size_t numDependencies);
CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from, const CUgraphNode* to, size_t numDependencies);
CUresult cuGraphDestroyNode(CUgraphNode hNode);
CUresult cuGraphInstantiate(CUgraphExec* phGraphExec, CUgraph hGraph, CUgraphNode* phErrorNode, char* logBuffer, size_t bufferSize);
CUresult cuGraphExecKernelNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams);
CUresult cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx);
CUresult cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx);
CUresult cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams);
CUresult cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream);
CUresult cuGraphExecDestroy(CUgraphExec hGraphExec);
CUresult cuGraphDestroy(CUgraph hGraph);
CUresult cuGraphExecUpdate(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphNode* hErrorNode_out, CUgraphExecUpdateResult* updateResult_out);
CUresult cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src);
CUresult cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr,
CUkernelNodeAttrValue* value_out);
CUresult cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr,
const CUkernelNodeAttrValue* value);
CUresult cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize);
CUresult cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags);
CUresult cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit);
CUresult cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags);
CUresult cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize);
__attribute__((deprecated)) CUresult cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags);
__attribute__((deprecated)) CUresult cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags);
__attribute__((deprecated)) CUresult cuTexRefSetAddress(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes);
__attribute__((deprecated)) CUresult cuTexRefSetAddress2D(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch);
__attribute__((deprecated)) CUresult cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents);
__attribute__((deprecated)) CUresult cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am);
__attribute__((deprecated)) CUresult cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm);
__attribute__((deprecated)) CUresult cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm);
__attribute__((deprecated)) CUresult cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias);
__attribute__((deprecated)) CUresult cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp);
__attribute__((deprecated)) CUresult cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso);
__attribute__((deprecated)) CUresult cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor);
__attribute__((deprecated)) CUresult cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags);
__attribute__((deprecated)) CUresult cuTexRefGetAddress(CUdeviceptr* pdptr, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim);
__attribute__((deprecated)) CUresult cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuTexRefCreate(CUtexref* pTexRef);
__attribute__((deprecated)) CUresult cuTexRefDestroy(CUtexref hTexRef);
__attribute__((deprecated)) CUresult cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags);
__attribute__((deprecated)) CUresult cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef);
CUresult cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc);
CUresult cuTexObjectDestroy(CUtexObject texObject);
CUresult cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject);
CUresult cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject);
CUresult cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject);
CUresult cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc);
CUresult cuSurfObjectDestroy(CUsurfObject surfObject);
CUresult cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject);
CUresult cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev);
CUresult cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags);
CUresult cuCtxDisablePeerAccess(CUcontext peerContext);
CUresult cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice);
CUresult cuGraphicsUnregisterResource(CUgraphicsResource resource);
CUresult cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel);
CUresult cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource);
CUresult cuGraphicsResourceGetMappedPointer(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource);
CUresult cuGraphicsResourceSetMapFlags(CUgraphicsResource resource, unsigned int flags);
CUresult cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream);
CUresult cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream);
CUresult cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId);
CUresult cuFuncGetModule(CUmodule* hmod, CUfunction hfunc);
|
294d25970d51e2dd6454bf1950aad462d6eaa6be
|
0744dcc5394cebf57ebcba343747af6871b67017
|
/external/iotivity/iotivity_1.2-rel/resource/csdk/security/provisioning/include/cloud/occloudprovisioning.h
|
6e2da24efb822aa8571526b9397c67bef3287a66
|
[
"Apache-2.0",
"GPL-2.0-only",
"MIT",
"BSD-3-Clause"
] |
permissive
|
Samsung/TizenRT
|
96abf62f1853f61fcf91ff14671a5e0c6ca48fdb
|
1a5c2e00a4b1bbf4c505bbf5cc6a8259e926f686
|
refs/heads/master
| 2023-08-31T08:59:33.327998
| 2023-08-08T06:09:20
| 2023-08-31T04:38:20
| 82,517,252
| 590
| 719
|
Apache-2.0
| 2023-09-14T06:54:49
| 2017-02-20T04:38:30
|
C
|
UTF-8
|
C
| false
| false
| 18,421
|
h
|
occloudprovisioning.h
|
/* *****************************************************************
*
* Copyright 2016 Samsung Electronics All Rights Reserved.
*
*
*
* 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.
*
* *****************************************************************/
#ifndef OC_CLOUD_PROVISIONING_H
#define OC_CLOUD_PROVISIONING_H
#include "octypes.h"
#include "securevirtualresourcetypes.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
typedef void (*OCCloudResponseCB )(void* ctx, OCStackResult result, void* data);
typedef struct cloudAce cloudAce_t;
struct cloudAce {
char *aceId;
OicUuid_t subjectuuid;
uint16_t stype;
uint16_t permission;
OicSecRsrc_t *resources;
OicSecValidity_t *validities;
cloudAce_t *next;
};
typedef struct {
char **array;
size_t length;
}stringArray_t;
typedef struct {
stringArray_t gidlist;
stringArray_t midlist;
}stringArrayPair_t;
typedef struct {
stringArrayPair_t invite;
stringArrayPair_t invited;
}inviteResponse_t;
/**
* Certificate-Issue request function
*
* @param[in] ctx user-defined context
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudCertificateIssueRequest(void* ctx,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* CRL GET request function
*
* @param[in] ctx user-defined context
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudGetCRL(void* ctx,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* CRL POST request function (with Serial Numbers list to revoke)
*
* @param[in] ctx user-defined context
* @param[in] thisUpdate mandatory parameter thisUpdate
* @param[in] nextUpdate mandatory parameter nextUpdate
* @param[in] crl optional parameter crl
* @param[in] serialNumbers optional parameter serial numbers
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudPostCRL(void* ctx,
const char *thisUpdate,
const char *nextUpdate,
const OCByteString *crl,
const stringArray_t *serialNumbers,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL id retrieve by device id
*
* @param[in] ctx user-defined context
* @param[in] deviceId mandatory parameter device id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudGetAclIdByDevice(void* ctx,
const char *deviceId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL id create
*
* @param[in] ctx user-defined context
* @param[in] ownerId mandatory parameter owner id
* @param[in] deviceId mandatory parameter device id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclIdCreate(void* ctx,
const char *ownerId,
const char *deviceId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL id delete
*
* @param[in] ctx user-defined context
* @param[in] aclId mandatory parameter acl id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclIdDelete(void* ctx,
const char *aclId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL individual get info
*
* @param[in] ctx user-defined context
* @param[in] aclId mandatory parameter acl id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclIndividualGetInfo(void* ctx,
const char *aclId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL individual update ACE
*
* @param[in] ctx user-defined context
* @param[in] aclId mandatory parameter acl id
* @param[in] aces mandatory parameter aces
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclIndividualUpdateAce(void* ctx,
const char *aclId,
const cloudAce_t *aces,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL individual update
*
* @param[in] ctx user-defined context
* @param[in] aclId mandatory parameter acl id
* @param[in] aceId mandatory parameter target ace id
* @param[in] aces mandatory parameter aces
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclIndividualUpdate(void* ctx,
const char *aclId,
const char *aceId,
const cloudAce_t *aces,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL individual delete - replaces ACE with given aceid with provided ACE
*
* @param[in] ctx user-defined context
* @param[in] aclId mandatory parameter acl id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclIndividualDelete(void* ctx,
const char *aclId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL individual delete ACE
*
* @param[in] ctx user-defined context
* @param[in] aclId mandatory parameter acl id
* @param[in] aceId target ace id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclIndividualDeleteAce(void* ctx,
const char *aclId,
const char *aceId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL post group request function
*
* @param[in] ctx user-defined context
* @param[in] groupType mandatory parameter group type
* @param[in] groupMasterId optional parameter group master id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclCreateGroup(void* ctx,
const char *groupType,
const char *groupMasterId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL get group request function
*
* @param[in] ctx user-defined context
* @param[in] memberId mandatory parameter member id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclFindMyGroup(void* ctx,
const char *memberId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL delete group request function
*
* @param[in] ctx user-defined context
* @param[in] groupId mandatory parameter group id
* @param[in] groupMasterId optional parameter group master id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclDeleteGroup(void* ctx,
const char *groupId,
const char *groupMasterId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL join to invited group request function
*
* @param[in] ctx user-defined context
* @param[in] groupId mandatory parameter group id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclJoinToInvitedGroup(void* ctx,
const char *groupId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL observe group request function
*
* @param[in] ctx user-defined context
* @param[in] groupId mandatory parameter group id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclObserveGroup(void* ctx,
const char *groupId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL share device into group request function
*
* @param[in] ctx user-defined context
* @param[in] groupId mandatory parameter group id
* @param[in] memberIds mandatory parameter members list
* @param[in] deviceIds mandatory parameter devices list
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclShareDeviceIntoGroup(void* ctx,
const char *groupId,
const stringArray_t *memberIds,
const stringArray_t *deviceIds,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL delete device from group request function
*
* @param[in] ctx user-defined context
* @param[in] groupId mandatory parameter group id
* @param[in] memberIds mandatory parameter members list
* @param[in] deviceIds mandatory parameter devices list
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclDeleteDeviceFromGroup(void* ctx,
const char *groupId,
const stringArray_t *memberIds,
const stringArray_t *deviceIds,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL get group info request function
*
* @param[in] ctx user-defined context
* @param[in] groupId mandatory parameter group id
* @param[in] memberId optional parameter member id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclGroupGetInfo(void* ctx,
const char *groupId,
const char *memberId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL invite user to group request function
*
* @param[in] ctx user-defined context
* @param[in] userId optional parameter user id
* @param[in] groupIds mandatory parameter groups list
* @param[in] memberIds mandatory parameter members list
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclInviteUser(void* ctx,
const char *userId,
const stringArray_t *groupIds,
const stringArray_t *memberIds,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL get invitation request function
*
* @param[in] ctx user-defined context
* @param[in] userId optional parameter user id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclGetInvitation(void* ctx,
const char *userId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL delete invitation request function (by receiver)
*
* @param[in] ctx user-defined context
* @param[in] userId optional parameter user id
* @param[in] groupId mandatory parameter group id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclDeleteInvitation(void* ctx,
const char *userId,
const char *groupId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL cancel invitation request function (by sender)
*
* @param[in] ctx user-defined context
* @param[in] userId optional parameter user id
* @param[in] groupId mandatory parameter group id
* @param[in] memberId mandatory parameter member id
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclCancelInvitation(void* ctx,
const char *userId,
const char *groupId,
const char *memberId,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
/**
* ACL check that given request can be applied to resource
*
* @param[in] ctx user-defined context
* @param[in] subjectId mandatory parameter subject id
* @param[in] deviceId mandatory parameter device id
* @param[in] method mandatory parameter method
* @param[in] uri mandatory parameter uri
* @param[in] endPoint cloud host and port
* @param[in] callback optional result callback, can be NULL if not required
* @return OCStackResult application result
*/
OCStackResult OCCloudAclPolicyCheck(void* ctx,
const char *subjectId,
const char *deviceId,
const char *method,
const char *uri,
const OCDevAddr *endPoint,
OCCloudResponseCB callback);
#ifdef __cplusplus
}
#endif // __cplusplus
#endif //OC_CLOUD_PROVISIONING_H
|
3629d3fa1ee9f033b1d13d02eb6d37cef616f130
|
a4c4f32b7e41472760e34e67f5eed5639cc63a3e
|
/examples/c-api/buildsystem/main.c
|
02d0cfb189002d931eff6a8c09cc1afc8de7c368
|
[
"Swift-exception",
"Apache-2.0"
] |
permissive
|
apple/swift-llbuild
|
d3054d10961d89fbedd9e172c0080d25e9291f1b
|
02c9df63a4e8b178e8c71d8cf08f07a13c0d1acc
|
refs/heads/main
| 2023-09-02T11:40:00.426241
| 2023-08-14T20:59:47
| 2023-08-14T20:59:47
| 44,838,988
| 1,137
| 250
|
Apache-2.0
| 2023-09-12T02:09:39
| 2015-10-23T21:15:45
|
C++
|
UTF-8
|
C
| false
| false
| 9,887
|
c
|
main.c
|
//===- main.c -------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2015 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file contains a basic example of using the libllbuild C APIs for working
// with the BuildSystem component.
//
//===----------------------------------------------------------------------===//
#include <llbuild/llbuild.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#if defined(_WIN32)
#include <windows.h>
#endif
static const char* progname;
static void usage() {
fprintf(stderr, "usage: %s <build file path>\n", progname);
exit(0);
}
#if !defined(__linux__)
static const char* basename(const char* path) {
const char* result = strrchr(path, '/');
return result ? result : path;
}
#endif
#if defined(_WIN32)
static wchar_t* convertToMultiByte(const char* s) {
int numChars = MultiByteToWideChar(
/*CodePage=*/CP_UTF8,
/*dwFlags=*/0,
/*lpMultibyteStr=*/s,
/*cbMultiByte=*/-1,
/*lpWideCharStr=*/NULL,
/*ccWideChar=*/0);
wchar_t* mbs = malloc(numChars * sizeof(wchar_t));
MultiByteToWideChar(
/*CodePage=*/CP_UTF8,
/*dwFlags=*/0,
/*lpMultibyteStr=*/s,
/*cbMultiByte=*/-1,
/*lpWideCharStr=*/mbs,
/*ccWideChar=*/numChars);
return mbs;
}
#endif
// "Fancy" Command Implementation
static void fancy_command_start(void* context,
llb_buildsystem_command_t* command,
llb_buildsystem_interface_t* bi,
llb_task_interface_t ti) {}
static void fancy_command_provide_value(void* context,
llb_buildsystem_command_t* command,
llb_buildsystem_interface_t* bi,
llb_task_interface_t ti,
const llb_build_value* value,
uintptr_t inputID) {}
static llb_buildsystem_command_result_t
fancy_command_execute_command(void *context, llb_buildsystem_command_t* command,
llb_buildsystem_interface_t* bi,
llb_task_interface_t ti,
llb_buildsystem_queue_job_context_t* job) {
printf("%s\n", __FUNCTION__);
fflush(stdout);
return llb_buildsystem_command_result_succeeded;
}
// "Fancy" Tool Implementation
static llb_buildsystem_command_t*
fancy_tool_create_command(void *context, const llb_data_t* name) {
llb_buildsystem_external_command_delegate_t delegate;
delegate.context = NULL;
delegate.get_signature = NULL;
delegate.configure = NULL;
delegate.start = fancy_command_start;
delegate.provide_value = fancy_command_provide_value;
delegate.execute_command = fancy_command_execute_command;
delegate.execute_command_ex = NULL;
delegate.execute_command_detached = NULL;
delegate.cancel_detached_command = NULL;
delegate.is_result_valid = NULL;
return llb_buildsystem_external_command_create(name, delegate);
}
// Build System Implementation
static bool fs_get_file_contents(void* context, const char* path,
llb_data_t* data_out) {
#if defined(_WIN32)
wchar_t* wPath = convertToMultiByte(path);
wprintf(L" -- read file contents: %ls\n", wPath);
fflush(stdout);
FILE* fp;
if (_wfopen_s(&fp, wPath, L"rb")) {
free(wPath);
return false;
}
free(wPath);
#else
printf(" -- read file contents: %s\n", path);
fflush(stdout);
FILE *fp = fopen(path, "rb");
if (!fp) {
return false;
}
#endif
fseek(fp, 0, SEEK_END);
long size = ftell(fp);
fseek(fp, 0, SEEK_SET);
uint8_t* buffer = (uint8_t*)llb_alloc(size);
if (!buffer) {
return false;
}
data_out->data = buffer;
data_out->length = size;
int n = fread(buffer, 1, size, fp);
if (n != size) {
return false;
}
return true;
}
static void fs_get_file_info(void* context, const char* path,
llb_fs_file_info_t* file_info_out) {
printf(" -- stat: %s\n", path);
fflush(stdout);
struct stat buf;
if (stat(path, &buf) != 0) {
memset(file_info_out, 0, sizeof(*file_info_out));
return;
}
file_info_out->device = buf.st_dev;
file_info_out->inode = buf.st_ino;
file_info_out->size = buf.st_size;
file_info_out->mod_time.seconds = buf.st_mtime;
file_info_out->mod_time.nanoseconds = 0;
}
static llb_buildsystem_tool_t* lookup_tool(void *context,
const llb_data_t* name) {
if (name->length == 5 && memcmp(name->data, "fancy", 5) == 0) {
llb_buildsystem_tool_delegate_t delegate = {0};
delegate.create_command = fancy_tool_create_command;
return llb_buildsystem_tool_create(name, delegate);
}
return NULL;
}
static void handle_diagnostic(void* context,
llb_buildsystem_diagnostic_kind_t kind,
const char* filename, int line, int column,
const char* message) {
const char* kindName = llb_buildsystem_diagnostic_kind_get_name(kind);
printf("%s:%d: %s: %s\n", filename, line, kindName, message);
fflush(stdout);
}
static void had_command_failure(void* context_p) {
printf("%s\n", __FUNCTION__);
fflush(stdout);
}
static void command_started(void* context,
llb_buildsystem_command_t* command) {
char* description = llb_buildsystem_command_get_description(command);
llb_data_t name;
llb_buildsystem_command_get_name(command, &name);
printf("%s: %.*s -- %s\n", __FUNCTION__, (int)name.length, name.data,
description);
llb_free(description);
fflush(stdout);
}
static void command_finished(void* context,
llb_buildsystem_command_t* command,
llb_buildsystem_command_result_t result) {
llb_data_t name;
llb_buildsystem_command_get_name(command, &name);
printf("%s: %.*s\n", __FUNCTION__, (int)name.length, name.data);
fflush(stdout);
}
static void command_found_discovered_dependency(void* context,
llb_buildsystem_command_t* command,
const char *path,
llb_buildsystem_discovered_dependency_kind_t kind) {
}
static void command_process_started(void* context,
llb_buildsystem_command_t* command,
llb_buildsystem_process_t* process) {
}
static void command_process_had_error(void* context,
llb_buildsystem_command_t* command,
llb_buildsystem_process_t* process,
const llb_data_t* data) {
llb_data_t name;
llb_buildsystem_command_get_name(command, &name);
printf("%s: %.*s\n", __FUNCTION__, (int)name.length, name.data);
fwrite(data->data, data->length, 1, stdout);
fflush(stdout);
}
static void command_process_had_output(void* context,
llb_buildsystem_command_t* command,
llb_buildsystem_process_t* process,
const llb_data_t* data) {
llb_data_t name;
llb_buildsystem_command_get_name(command, &name);
printf("%s: %.*s\n", __FUNCTION__, (int)name.length, name.data);
fwrite(data->data, data->length, 1, stdout);
fflush(stdout);
}
static void command_process_finished(void* context,
llb_buildsystem_command_t* command,
llb_buildsystem_process_t* process,
const llb_buildsystem_command_extended_result_t* result) {
}
int main(int argc, char **argv) {
progname = basename(argv[0]);
if (argc != 2) {
usage();
}
const char* buildFilePath = argv[1];
// Create an invocation.
llb_buildsystem_invocation_t invocation = {0};
invocation.buildFilePath = buildFilePath;
invocation.useSerialBuild = true;
// Create a build system delegate.
llb_buildsystem_delegate_t delegate = {0};
delegate.context = NULL;
delegate.fs_get_file_contents = fs_get_file_contents;
delegate.fs_get_file_info = fs_get_file_info;
delegate.lookup_tool = lookup_tool;
delegate.handle_diagnostic = handle_diagnostic;
delegate.had_command_failure = had_command_failure;
delegate.command_started = command_started;
delegate.command_finished = command_finished;
delegate.command_found_discovered_dependency = command_found_discovered_dependency;
delegate.command_process_started = command_process_started;
delegate.command_process_had_error = command_process_had_error;
delegate.command_process_had_output = command_process_had_output;
delegate.command_process_finished = command_process_finished;
// Create a build system.
llb_buildsystem_t* system = llb_buildsystem_create(delegate, invocation);
// Initialize the system.
llb_buildsystem_initialize(system);
// Build the default target, twice.
llb_data_t key = { 0, NULL };
printf("initial build:\n");
if (!llb_buildsystem_build(system, &key)) {
printf("build had command failures\n");
}
printf("second build:\n");
if (!llb_buildsystem_build(system, &key)) {
printf("build had command failures\n");
}
// Destroy the build system.
llb_buildsystem_destroy(system);
return 0;
}
|
4c1ece5ae8716535fed08b797f87261b34f4a57f
|
7df190df28da7e4ff166e55dc8ce780f11236a9f
|
/redboot/packages/devs/flash/intel/strata/current/src/flash_program_buf.c
|
a96a20155f4592412d88dd8d9dae4d6a34c1cc79
|
[] |
no_license
|
mirror/dd-wrt
|
25416946e6132aa54b35809de61834a1825a9a36
|
8f2934a5a2adfbb59b471375aa3a38de5d036531
|
refs/heads/master
| 2023-08-31T14:54:47.496685
| 2023-08-30T17:40:54
| 2023-08-30T17:40:54
| 7,470,282
| 520
| 281
| null | 2023-05-29T20:56:24
| 2013-01-06T17:21:29
| null |
UTF-8
|
C
| false
| false
| 5,365
|
c
|
flash_program_buf.c
|
//==========================================================================
//
// flash_program_buf.c
//
// Flash programming
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Red Hat, Inc.
//
// eCos 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.
//
// eCos is distributed in the hope that 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 eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): gthomas, hmt
// Contributors: gthomas
// Date: 2001-02-14
// Purpose:
// Description:
//
//####DESCRIPTIONEND####
//
//==========================================================================
#include "strata.h"
#include <pkgconf/hal.h>
#include <cyg/hal/hal_arch.h>
// Platforms may define this for special handling when accessing the write buffer.
#ifndef CYGHWR_FLASH_WRITE_BUF
#define CYGHWR_FLASH_WRITE_BUF(a,b) (*(a) = *(b))
#endif
int
flash_program_buf(volatile flash_t *addr, flash_t *data, int len,
unsigned long block_mask, int buffer_size)
__attribute__ ((section (".2ram.flash_program_buf")));
int
flash_program_buf(volatile flash_t *addr, flash_t *data, int len,
unsigned long block_mask, int buffer_size)
{
volatile flash_t *ROM;
volatile flash_t *BA;
flash_t stat = 0;
int timeout = 50000;
#ifdef FLASH_Write_Buffer
int i, wc;
#endif
// Get base address and map addresses to virtual addresses
ROM = FLASH_P2V( CYGNUM_FLASH_BASE_MASK & (unsigned int)addr );
BA = addr = FLASH_P2V(addr);
// Clear any error conditions
ROM[0] = FLASH_Clear_Status;
#ifdef FLASH_Write_Buffer
// Write any big chunks first
while (len >= buffer_size) {
wc = buffer_size;
if (wc > len) wc = len;
len -= wc;
// convert 'wc' in bytes to 'wc' in 'flash_t'
wc = wc / sizeof(flash_t); // Word count
*BA = FLASH_Write_Buffer;
timeout = 5000000;
while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
if (--timeout == 0) {
goto bad;
}
*BA = FLASH_Write_Buffer;
}
*BA = FLASHWORD(wc-1); // Count is 0..N-1
for (i = 0; i < wc; i++) {
#ifdef CYGHWR_FLASH_WRITE_ELEM
CYGHWR_FLASH_WRITE_ELEM(addr+i, data+i);
#else
CYGHWR_FLASH_WRITE_BUF(addr+i, data+i);
#endif
}
*BA = FLASH_Confirm;
ROM[0] = FLASH_Read_Status;
timeout = 5000000;
while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
if (--timeout == 0) {
goto bad;
}
}
// Jump out if there was an error
if (stat & FLASH_ErrorMask) {
goto bad;
}
// And verify the data - also increments the pointers.
*BA = FLASH_Reset;
for (i = 0; i < wc; i++) {
if ( *addr++ != *data++ ) {
stat = FLASH_ErrorNotVerified;
goto bad;
}
}
}
#endif
while (len > 0) {
BA[0] = FLASH_Program;
#ifdef CYGHWR_FLASH_WRITE_ELEM
CYGHWR_FLASH_WRITE_ELEM(addr, data);
#else
*addr = *data;
#endif
timeout = 5000000;
while(((stat = BA[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
if (--timeout == 0) {
goto bad;
}
}
if (stat & FLASH_ErrorMask) {
break;
}
BA[0] = FLASH_Reset;
if (*addr++ != *data++) {
stat = FLASH_ErrorNotVerified;
break;
}
len -= sizeof( flash_t );
}
// Restore ROM to "normal" mode
bad:
BA[0] = FLASH_Reset;
return stat;
}
|
2256cc0d2805ddfbfa197bdbd4fa4e46a2e0c0c1
|
321d11eaee885ceb3a74db0a062f9bbdf282148c
|
/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
|
6aaf3f06fb490f9f63249fde43598e287656571b
|
[
"Apache-2.0",
"OpenSSL",
"LicenseRef-scancode-proprietary-license"
] |
permissive
|
openssl/openssl
|
75691ebaae957793f2ff0673f77545277dfb3988
|
5318c012885a5382eadbf95aa9c1d35664bca819
|
refs/heads/master
| 2023-09-03T15:22:52.727123
| 2023-09-01T07:10:49
| 2023-09-02T14:30:01
| 7,634,677
| 24,148
| 11,569
|
Apache-2.0
| 2023-09-14T19:48:11
| 2013-01-15T22:34:48
|
C
|
UTF-8
|
C
| false
| false
| 2,278
|
h
|
cipher_aes_cbc_hmac_sha.h
|
/*
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include "prov/ciphercommon.h"
#include "crypto/aes_platform.h"
int ossl_cipher_capable_aes_cbc_hmac_sha1(void);
int ossl_cipher_capable_aes_cbc_hmac_sha256(void);
typedef struct prov_cipher_hw_aes_hmac_sha_ctx_st {
PROV_CIPHER_HW base; /* must be first */
void (*init_mac_key)(void *ctx, const unsigned char *inkey, size_t inlen);
int (*set_tls1_aad)(void *ctx, unsigned char *aad_rec, int aad_len);
# if !defined(OPENSSL_NO_MULTIBLOCK)
int (*tls1_multiblock_max_bufsize)(void *ctx);
int (*tls1_multiblock_aad)(
void *vctx, EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *param);
int (*tls1_multiblock_encrypt)(
void *ctx, EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM *param);
# endif /* OPENSSL_NO_MULTIBLOCK) */
} PROV_CIPHER_HW_AES_HMAC_SHA;
const PROV_CIPHER_HW_AES_HMAC_SHA *ossl_prov_cipher_hw_aes_cbc_hmac_sha1(void);
const PROV_CIPHER_HW_AES_HMAC_SHA *ossl_prov_cipher_hw_aes_cbc_hmac_sha256(void);
#ifdef AES_CBC_HMAC_SHA_CAPABLE
# include <openssl/aes.h>
# include <openssl/sha.h>
typedef struct prov_aes_hmac_sha_ctx_st {
PROV_CIPHER_CTX base;
AES_KEY ks;
size_t payload_length; /* AAD length in decrypt case */
union {
unsigned int tls_ver;
unsigned char tls_aad[16]; /* 13 used */
} aux;
const PROV_CIPHER_HW_AES_HMAC_SHA *hw;
/* some value that are setup by set methods - that can be retrieved */
unsigned int multiblock_interleave;
unsigned int multiblock_aad_packlen;
size_t multiblock_max_send_fragment;
size_t multiblock_encrypt_len;
size_t tls_aad_pad;
} PROV_AES_HMAC_SHA_CTX;
typedef struct prov_aes_hmac_sha1_ctx_st {
PROV_AES_HMAC_SHA_CTX base_ctx;
SHA_CTX head, tail, md;
} PROV_AES_HMAC_SHA1_CTX;
typedef struct prov_aes_hmac_sha256_ctx_st {
PROV_AES_HMAC_SHA_CTX base_ctx;
SHA256_CTX head, tail, md;
} PROV_AES_HMAC_SHA256_CTX;
# define NO_PAYLOAD_LENGTH ((size_t)-1)
#endif /* AES_CBC_HMAC_SHA_CAPABLE */
|
2b1827ec193da096558f47c7855820dd0e94fdd2
|
bb38c44037a99d0a12a12d92059678f2faebbc80
|
/src/include/dbmind/hypopg_index.h
|
bd507d479321b83274c1aec3a37cbc0bfd040919
|
[
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference",
"PostgreSQL",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-warranty-disclaimer",
"curl",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"CC-BY-4.0",
"LicenseRef-scancode-protobuf",
"OpenSSL",
"LicenseRef-scancode-generic-export-compliance",
"X11-distribute-modifications-variant",
"LicenseRef-scancode-other-permissive",
"MIT",
"NCSA",
"Python-2.0",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-ssleay-windows",
"CC-BY-3.0",
"LicenseRef-scancode-other-copyleft",
"GPL-2.0-only",
"BSL-1.0",
"Apache-2.0",
"LGPL-2.0-only",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"Zlib"
] |
permissive
|
opengauss-mirror/openGauss-server
|
a9c5a62908643492347830826c56da49f0942796
|
310e84631c68c8bf37b004148b66f94064f701e4
|
refs/heads/master
| 2023-07-26T19:29:12.495484
| 2023-07-17T12:23:32
| 2023-07-17T12:23:32
| 276,117,477
| 591
| 208
|
MulanPSL-2.0
| 2023-04-28T12:30:18
| 2020-06-30T14:08:59
|
C++
|
UTF-8
|
C
| false
| false
| 3,550
|
h
|
hypopg_index.h
|
/* -------------------------------------------------------------------------
*
* hypopg_index.h: Implementation of hypothetical indexes for openGauss
*
* This file contains all includes for the internal code related to
* hypothetical indexes support.
*
* This program is open source, licensed under the PostgreSQL license.
* For license terms, see the LICENSE file.
*
* Portions Copyright (c) 2020 Huawei Technologies Co.,Ltd.
* Copyright (C) 2015-2018: Julien Rouhaud
*
*
* IDENTIFICATION
* src/include/dbmind/hypopg_index.h
*
* -------------------------------------------------------------------------
*/
#ifndef _HYPOPG_INDEX_H_
#define _HYPOPG_INDEX_H_
/* --------------------------------------------------------
* Hypothetical index storage, pretty much an IndexOptInfo
* Some dynamic informations such as pages and lines are not stored but
* computed when the hypothetical index is used.
*/
typedef struct hypoIndex {
Oid oid; /* hypothetical index unique identifier */
Oid relid; /* related relation Oid */
Oid reltablespace; /* tablespace of the index, if set */
char *indexname; /* hypothetical index name */
BlockNumber pages; /* number of estimated disk pages for the
* index */
double tuples; /* number of estimated tuples in the index */
/* index descriptor informations */
int ncolumns; /* number of columns, only 1 for now */
int nkeycolumns; /* number of key columns */
short int *indexkeys; /* attnums */
Oid *indexcollations; /* OIDs of collations of index columns */
Oid *opfamily; /* OIDs of operator families for columns */
Oid *opclass; /* OIDs of opclass data types */
Oid *opcintype; /* OIDs of opclass declared input data types */
Oid *sortopfamily; /* OIDs of btree opfamilies, if orderable */
bool *reverse_sort; /* is sort order descending? */
bool *nulls_first; /* do NULLs come first in the sort order? */
Oid relam; /* OID of the access method (in pg_am) */
RegProcedure amcostestimate; /* OID of the access method's cost fcn */
RegProcedure amcanreturn; /* OID of the access method's canreturn fcn */
List *indexprs; /* expressions for non-simple index columns */
List *indpred; /* predicate if a partial index, else NIL */
bool predOK; /* true if predicate matches query */
bool unique; /* true if a unique index */
bool immediate; /* is uniqueness enforced immediately? */
bool canreturn; /* can index return IndexTuples? */
bool amcanorderbyop; /* does AM support order by operator result? */
bool amoptionalkey; /* can query omit key for the first column? */
bool amsearcharray; /* can AM handle ScalarArrayOpExpr quals? */
bool amsearchnulls; /* can AM search for NULL/NOT NULL entries? */
bool amhasgettuple; /* does AM have amgettuple interface? */
bool amhasgetbitmap; /* does AM have amgetbitmap interface? */
bool amcanunique; /* does AM support UNIQUE indexes? */
bool amcanmulticol; /* does AM support multi-column indexes? */
bool isGlobal; /* true if index is global partition index */
bool ispartitionedindex; /* it is an partitioned index */
/* store some informations usually saved in catalogs */
List *options; /* WITH clause options: a list of DefElem */
bool amcanorder; /* does AM support order by column value? */
} hypoIndex;
void InitHypopg();
void hypopg_register_hook();
#endif
|
1eb35fffbefdd99c5e5acaf6135fd2d70d504da0
|
6c287b46a483ede6fe079e40c6e823853f395a6a
|
/SmartDeviceLink/private/SDLLockScreenConstants.h
|
0865666ae9cd4f084493569d688a7b55348cbc7a
|
[] |
permissive
|
smartdevicelink/sdl_ios
|
50fded2de845b8406071d84225db80a0481961cb
|
2c3d561468ee67a4b298e4976a1ac2699853c11e
|
refs/heads/develop
| 2023-07-14T06:14:09.622236
| 2023-06-29T17:31:21
| 2023-06-29T17:31:21
| 24,940,582
| 188
| 129
|
BSD-3-Clause
| 2023-06-29T17:31:22
| 2014-10-08T12:57:22
|
Objective-C
|
UTF-8
|
C
| false
| false
| 477
|
h
|
SDLLockScreenConstants.h
|
//
// SDLLockScreenConstants.h
// SmartDeviceLink-iOS
//
// Created by Nicole on 9/4/20.
// Copyright © 2020 smartdevicelink. All rights reserved.
//
NS_ASSUME_NONNULL_BEGIN
/// Describes the status of the lock screen
typedef NS_ENUM(NSUInteger, SDLLockScreenStatus) {
SDLLockScreenStatusOff, // LockScreen is not required
SDLLockScreenStatusOptional, // LockScreen is optional
SDLLockScreenStatusRequired // LockScreen is required
};
NS_ASSUME_NONNULL_END
|
0d44e0244fe13c551839d2d6ac9064e367e6d5ac
|
f9e7d65cb784c01a0200145ba8d289afe41d4a56
|
/common/onewire.c
|
43080d096ee4a7041b5386120cf32e1f87d44ff2
|
[
"BSD-3-Clause"
] |
permissive
|
FrameworkComputer/EmbeddedController
|
ad7086769e87d0a4179eae96a7c9ff5e383ff54e
|
f6d6b927eed71550d3475411cfc3e59abe5cef2a
|
refs/heads/hx20-hx30
| 2023-08-08T20:45:10.621169
| 2023-05-26T07:03:59
| 2023-05-26T07:03:59
| 447,021,040
| 846
| 48
|
BSD-3-Clause
| 2023-05-26T07:04:59
| 2022-01-12T00:11:14
|
C
|
UTF-8
|
C
| false
| false
| 3,371
|
c
|
onewire.c
|
/* Copyright 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* 1-wire interface module for Chrome EC */
#include "common.h"
#include "gpio.h"
#include "task.h"
#include "timer.h"
/*
* Standard speed; all timings padded by 2 usec for safety.
*
* Note that these timing are actually _longer_ than legacy 1-wire standard
* speed because we're running the 1-wire bus at 3.3V instead of 5V.
*/
#define T_RSTL 602 /* Reset low pulse; 600-960 us */
#define T_MSP 72 /* Presence detect sample time; 70-75 us */
#define T_RSTH (68 + 260 + 5 + 2) /* Reset high; tPDHmax + tPDLmax + tRECmin */
#define T_SLOT 70 /* Timeslot; >67 us */
#define T_W0L 63 /* Write 0 low; 62-120 us */
#define T_W1L 7 /* Write 1 low; 5-15 us */
#define T_RL 7 /* Read low; 5-15 us */
#define T_MSR 9 /* Read sample time; <15 us. Must be at least 200 ns after
* T_RL since that's how long the signal takes to be pulled
* up on our board. */
/**
* Output low on the bus for <usec> us, then switch back to open-drain input.
*/
static void output0(int usec)
{
gpio_set_flags(GPIO_ONEWIRE,
GPIO_OPEN_DRAIN | GPIO_OUTPUT | GPIO_OUT_LOW);
udelay(usec);
gpio_set_flags(GPIO_ONEWIRE, GPIO_INPUT);
}
/**
* Read a bit.
*/
static int readbit(void)
{
int bit;
/*
* The delay between sending the output pulse and reading the bit is
* extremely timing sensitive, so disable interrupts.
*/
interrupt_disable();
/* Output low */
output0(T_RL);
/* Delay to let slave release the line if it wants to send a 1-bit */
udelay(T_MSR - T_RL);
/* Read bit */
bit = gpio_get_level(GPIO_ONEWIRE);
/*
* Enable interrupt as soon as we've read the bit. The delay to the
* end of the timeslot is a lower bound, so additional latency here is
* harmless.
*/
interrupt_enable();
/* Delay to end of timeslot */
udelay(T_SLOT - T_MSR);
return bit;
}
/**
* Write a bit.
*/
static void writebit(int bit)
{
/*
* The delays in the output-low signal for sending 0 and 1 bits are
* extremely timing sensitive, so disable interrupts during that time.
* Interrupts can be enabled again as soon as the output is switched
* back to open-drain, since the delay for the rest of the timeslot is
* a lower bound.
*/
if (bit) {
interrupt_disable();
output0(T_W1L);
interrupt_enable();
udelay(T_SLOT - T_W1L);
} else {
interrupt_disable();
output0(T_W0L);
interrupt_enable();
udelay(T_SLOT - T_W0L);
}
}
int onewire_reset(void)
{
/* Start transaction with master reset pulse */
output0(T_RSTL);
/* Wait for presence detect sample time.
*
* (Alternately, we could poll waiting for a 1-bit indicating our pulse
* has let go, then poll up to max time waiting for a 0-bit indicating
* the slave has responded.)
*/
udelay(T_MSP);
if (gpio_get_level(GPIO_ONEWIRE))
return EC_ERROR_UNKNOWN;
/*
* Wait for end of presence pulse.
*
* (Alternately, we could poll waiting for a 1-bit.)
*/
udelay(T_RSTH - T_MSP);
return EC_SUCCESS;
}
int onewire_read(void)
{
int data = 0;
int i;
for (i = 0; i < 8; i++)
data |= readbit() << i; /* LSB first */
return data;
}
void onewire_write(int data)
{
int i;
for (i = 0; i < 8; i++)
writebit((data >> i) & 0x01); /* LSB first */
}
|
30045ae7bb2806eb100d9642f0f5d5319399f07a
|
7e1cd9b94c0c8c443f993362dc185dfc35ceb963
|
/interface/vmcs_host/vcilcs_out.c
|
545ddc7f1aecacf14caa67779a61027cd057c600
|
[
"BSD-3-Clause"
] |
permissive
|
raspberrypi/userland
|
92e557234bb6d7f701066543e0efc36dfb54a52c
|
cc1ca18fb0689b01cc2ca2aa4b400dcee624a213
|
refs/heads/master
| 2023-08-20T15:41:23.695645
| 2023-04-19T10:38:04
| 2023-04-20T13:36:13
| 6,367,886
| 1,608
| 928
|
BSD-3-Clause
| 2023-09-13T09:54:26
| 2012-10-24T09:58:46
|
C
|
UTF-8
|
C
| false
| false
| 30,465
|
c
|
vcilcs_out.c
|
/*
Copyright (c) 2012, Broadcom Europe 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 the copyright holder 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.
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include "interface/vchi/vchi.h"
#include "interface/vcos/vcos_dlfcn.h"
#include "interface/vmcs_host/khronos/IL/OMX_Component.h"
#include "interface/vmcs_host/khronos/IL/OMX_ILCS.h"
#include "interface/vmcs_host/vc_ilcs_defs.h"
#include "interface/vmcs_host/vcilcs.h"
#include "interface/vmcs_host/vcilcs_common.h"
#include "interface/vcos/vcos_dlfcn.h"
static VC_PRIVATE_PORT_T *find_port(VC_PRIVATE_COMPONENT_T *comp, OMX_U32 nPortIndex)
{
OMX_U32 i=0;
while (i<comp->numPorts && comp->port[i].port != nPortIndex)
i++;
if (i < comp->numPorts)
return &comp->port[i];
return NULL;
}
#ifndef NDEBUG
static int is_valid_hostside_buffer(OMX_BUFFERHEADERTYPE *pBuf)
{
if (!pBuf)
return 0;
if (!pBuf->pBuffer)
return 0;
if ((unsigned long)pBuf->pBuffer < 0x100)
return 0; // not believable
return 1;
}
#endif
static OMX_ERRORTYPE vcil_out_ComponentDeInit(OMX_IN OMX_HANDLETYPE hComponent)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_EXECUTE_HEADER_T exe;
IL_RESPONSE_HEADER_T resp;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if(!pComp)
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
exe.reference = comp->reference;
if(ilcs_execute_function(st->ilcs, IL_COMPONENT_DEINIT, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp) ||
resp.err == OMX_ErrorNone)
{
// remove from list, assuming that we successfully managed to deinit
// this component, or that ilcs has returned an error. The assumption
// here is that if the component has managed to correctly signal an
// error, it still exists, but if the transport has failed then we might
// as well try and cleanup
VC_PRIVATE_COMPONENT_T *list, *prev;
vcos_semaphore_wait(&st->component_lock);
list = st->component_list;
prev = NULL;
while (list != NULL && list != comp)
{
prev = list;
list = list->next;
}
// failing to find this component is not a good sign.
if(vcos_verify(list))
{
if (prev == NULL)
st->component_list = list->next;
else
prev->next = list->next;
}
vcos_semaphore_post(&st->component_lock);
vcos_free(comp);
}
return resp.err;
}
static OMX_ERRORTYPE vcil_out_GetComponentVersion(OMX_IN OMX_HANDLETYPE hComponent,
OMX_OUT OMX_STRING pComponentName,
OMX_OUT OMX_VERSIONTYPE* pComponentVersion,
OMX_OUT OMX_VERSIONTYPE* pSpecVersion,
OMX_OUT OMX_UUIDTYPE* pComponentUUID)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_EXECUTE_HEADER_T exe;
IL_GET_VERSION_RESPONSE_T resp;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if (!(pComp && pComponentName && pComponentVersion && pSpecVersion && pComponentUUID))
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
exe.reference = comp->reference;
if(ilcs_execute_function(st->ilcs, IL_GET_COMPONENT_VERSION, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
strncpy(pComponentName, resp.name, 128);
pComponentName[127] = 0;
*pComponentVersion = resp.component_version;
*pSpecVersion = resp.spec_version;
memcpy(pComponentUUID, resp.uuid, sizeof(OMX_UUIDTYPE));
return resp.err;
}
static OMX_ERRORTYPE vcil_out_SetCallbacks(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_CALLBACKTYPE* pCallbacks,
OMX_IN OMX_PTR pAppData)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_SET_CALLBACKS_EXECUTE_T exe;
IL_RESPONSE_HEADER_T resp;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if(!(pComp && pCallbacks))
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
comp->callbacks = *pCallbacks;
comp->callback_state = pAppData;
exe.reference = comp->reference;
exe.pAppData = pComp;
if(ilcs_execute_function(st->ilcs, IL_SET_CALLBACKS, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
return resp.err;
}
static OMX_ERRORTYPE vcil_out_GetState(OMX_IN OMX_HANDLETYPE hComponent,
OMX_OUT OMX_STATETYPE* pState)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_EXECUTE_HEADER_T exe;
IL_GET_STATE_RESPONSE_T resp;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if (!(pComp && pState))
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
exe.reference = comp->reference;
if(ilcs_execute_function(st->ilcs, IL_GET_STATE, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
*pState = resp.state;
return resp.err;
}
static OMX_ERRORTYPE vcil_out_get(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_INDEXTYPE nParamIndex,
OMX_INOUT OMX_PTR pComponentParameterStructure,
IL_FUNCTION_T func)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_GET_EXECUTE_T exe;
IL_GET_RESPONSE_T resp;
OMX_U32 size;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if (!(pComp && pComponentParameterStructure))
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
exe.reference = comp->reference;
exe.index = nParamIndex;
size = *((OMX_U32 *) pComponentParameterStructure);
if(size > VC_ILCS_MAX_PARAM_SIZE)
return OMX_ErrorHardware;
memcpy(exe.param, pComponentParameterStructure, size);
if(ilcs_execute_function(st->ilcs, func, &exe, size + IL_GET_EXECUTE_HEADER_SIZE, &resp, &rlen) < 0 || rlen > sizeof(resp))
return OMX_ErrorHardware;
memcpy(pComponentParameterStructure, resp.param, size);
return resp.err;
}
static OMX_ERRORTYPE vcil_out_set(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_INDEXTYPE nParamIndex,
OMX_IN OMX_PTR pComponentParameterStructure,
IL_FUNCTION_T func)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_SET_EXECUTE_T exe;
IL_RESPONSE_HEADER_T resp;
OMX_U32 size;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if (!(pComp && pComponentParameterStructure))
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
exe.reference = comp->reference;
exe.index = nParamIndex;
size = *((OMX_U32 *) pComponentParameterStructure);
if(size > VC_ILCS_MAX_PARAM_SIZE)
return OMX_ErrorHardware;
memcpy(exe.param, pComponentParameterStructure, size);
if(ilcs_execute_function(st->ilcs, func, &exe, size + IL_SET_EXECUTE_HEADER_SIZE, &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
return resp.err;
}
static OMX_ERRORTYPE vcil_out_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_INDEXTYPE nParamIndex,
OMX_INOUT OMX_PTR pComponentParameterStructure)
{
return vcil_out_get(hComponent, nParamIndex, pComponentParameterStructure, IL_GET_PARAMETER);
}
static OMX_ERRORTYPE vcil_out_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_INDEXTYPE nParamIndex,
OMX_IN OMX_PTR pComponentParameterStructure)
{
return vcil_out_set(hComponent, nParamIndex, pComponentParameterStructure, IL_SET_PARAMETER);
}
static OMX_ERRORTYPE vcil_out_GetConfig(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_INDEXTYPE nParamIndex,
OMX_INOUT OMX_PTR pComponentParameterStructure)
{
return vcil_out_get(hComponent, nParamIndex, pComponentParameterStructure, IL_GET_CONFIG);
}
static OMX_ERRORTYPE vcil_out_SetConfig(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_INDEXTYPE nParamIndex,
OMX_IN OMX_PTR pComponentParameterStructure)
{
return vcil_out_set(hComponent, nParamIndex, pComponentParameterStructure, IL_SET_CONFIG);
}
static OMX_ERRORTYPE vcil_out_SendCommand(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_COMMANDTYPE Cmd,
OMX_IN OMX_U32 nParam1,
OMX_IN OMX_PTR pCmdData)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_SEND_COMMAND_EXECUTE_T exe;
IL_RESPONSE_HEADER_T resp;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if (!pComp)
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
exe.reference = comp->reference;
exe.cmd = Cmd;
exe.param = nParam1;
if (Cmd == OMX_CommandMarkBuffer)
{
exe.mark = *((OMX_MARKTYPE *) pCmdData);
}
else
{
exe.mark.hMarkTargetComponent = 0;
exe.mark.pMarkData = 0;
}
if(ilcs_execute_function(st->ilcs, IL_SEND_COMMAND, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
return resp.err;
}
// Called to pass a buffer from the host-side across the interface to videcore.
static OMX_ERRORTYPE vcil_out_addBuffer(OMX_IN OMX_HANDLETYPE hComponent,
OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
OMX_IN OMX_U32 nPortIndex,
OMX_IN OMX_PTR pAppPrivate,
OMX_IN OMX_U32 nSizeBytes,
OMX_IN OMX_U8* pBuffer,
OMX_IN void *eglImage,
IL_FUNCTION_T func)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_ADD_BUFFER_EXECUTE_T exe;
IL_ADD_BUFFER_RESPONSE_T resp;
OMX_BUFFERHEADERTYPE *pHeader;
VC_PRIVATE_PORT_T *port;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if (!(pComp && ppBufferHdr))
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
port = find_port(comp, nPortIndex);
if (!port) // bad port index
return OMX_ErrorBadPortIndex;
if (port->numBuffers > 0 && port->func != func)
{
// inconsistent use of usebuffer/allocatebuffer/eglimage
// all ports must receive all buffers by exactly one of these methods
vc_assert(port->func != func);
return OMX_ErrorInsufficientResources;
}
port->func = func;
if (!VCHI_BULK_ALIGNED(pBuffer))
{
// cannot transfer this buffer across the host interface
return OMX_ErrorBadParameter;
}
pHeader = vcos_malloc(sizeof(*pHeader), "vcout buffer header");
if (!pHeader)
return OMX_ErrorInsufficientResources;
if (func == IL_ALLOCATE_BUFFER)
{
pBuffer = vcos_malloc_aligned(nSizeBytes, ILCS_ALIGN, "vcout mapping buffer");
if (!pBuffer)
{
vcos_free(pHeader);
return OMX_ErrorInsufficientResources;
}
}
exe.reference = comp->reference;
exe.bufferReference = pHeader;
exe.port = nPortIndex;
exe.size = nSizeBytes;
exe.eglImage = eglImage;
if(ilcs_execute_function(st->ilcs, func, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
resp.err = OMX_ErrorHardware;
if (resp.err == OMX_ErrorNone)
{
memcpy(pHeader, &resp.bufferHeader, sizeof(OMX_BUFFERHEADERTYPE));
if (port->dir == OMX_DirOutput)
pHeader->pOutputPortPrivate = resp.reference;
else
pHeader->pInputPortPrivate = resp.reference;
if (func == IL_USE_EGL_IMAGE)
{
pHeader->pBuffer = (OMX_U8*)eglImage;
port->bEGL = OMX_TRUE;
}
else
{
pHeader->pBuffer = pBuffer;
port->bEGL = OMX_FALSE;
}
pHeader->pAppPrivate = pAppPrivate;
*ppBufferHdr = pHeader;
port->numBuffers++;
}
else
{
if (func == IL_ALLOCATE_BUFFER)
vcos_free(pBuffer);
vcos_free(pHeader);
}
return resp.err;
}
static VCOS_ONCE_T loaded_eglIntOpenMAXILDoneMarker = VCOS_ONCE_INIT;
static int (*local_eglIntOpenMAXILDoneMarker) (void* component_handle, void *egl_image) = NULL;
static void load_eglIntOpenMAXILDoneMarker(void)
{
void *handle;
/* First try to load from the current process, this will succeed
* if something that is linked to libEGL is already loaded or
* something explicitly loaded libEGL with RTLD_GLOBAL
*/
handle = vcos_dlopen(NULL, VCOS_DL_GLOBAL);
local_eglIntOpenMAXILDoneMarker = (void * )vcos_dlsym(handle, "eglIntOpenMAXILDoneMarker");
if (local_eglIntOpenMAXILDoneMarker == NULL)
{
vcos_dlclose(handle);
/* If that failed try to load libEGL.so explicitely */
handle = vcos_dlopen("libEGL.so", VCOS_DL_LAZY | VCOS_DL_LOCAL);
vc_assert(handle != NULL);
local_eglIntOpenMAXILDoneMarker = (void * )vcos_dlsym(handle, "eglIntOpenMAXILDoneMarker");
vc_assert(local_eglIntOpenMAXILDoneMarker != NULL);
}
}
static OMX_ERRORTYPE vcil_out_UseEGLImage(OMX_IN OMX_HANDLETYPE hComponent,
OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
OMX_IN OMX_U32 nPortIndex,
OMX_IN OMX_PTR pAppPrivate,
OMX_IN void* eglImage)
{
/* Load eglIntOpenMAXILDoneMarker() and libEGL here, it will be needed later */
vcos_once(&loaded_eglIntOpenMAXILDoneMarker, load_eglIntOpenMAXILDoneMarker);
return vcil_out_addBuffer(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, 0, NULL, eglImage, IL_USE_EGL_IMAGE);
}
static OMX_ERRORTYPE vcil_out_UseBuffer(OMX_IN OMX_HANDLETYPE hComponent,
OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
OMX_IN OMX_U32 nPortIndex,
OMX_IN OMX_PTR pAppPrivate,
OMX_IN OMX_U32 nSizeBytes,
OMX_IN OMX_U8* pBuffer)
{
return vcil_out_addBuffer(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer, NULL, IL_USE_BUFFER);
}
static OMX_ERRORTYPE vcil_out_AllocateBuffer(OMX_IN OMX_HANDLETYPE hComponent,
OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
OMX_IN OMX_U32 nPortIndex,
OMX_IN OMX_PTR pAppPrivate,
OMX_IN OMX_U32 nSizeBytes)
{
return vcil_out_addBuffer(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, NULL, NULL, IL_ALLOCATE_BUFFER);
}
static OMX_ERRORTYPE vcil_out_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_U32 nPortIndex,
OMX_IN OMX_BUFFERHEADERTYPE* pBufferHdr)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_FREE_BUFFER_EXECUTE_T exe;
IL_RESPONSE_HEADER_T resp;
VC_PRIVATE_PORT_T *port;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if (!(pComp && pBufferHdr))
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
port = find_port(comp, nPortIndex);
if (!port)
return OMX_ErrorBadPortIndex;
if (port->numBuffers == 0)
return OMX_ErrorIncorrectStateTransition;
exe.reference = comp->reference;
exe.port = nPortIndex;
if (port->dir == OMX_DirOutput)
exe.bufferReference = pBufferHdr->pOutputPortPrivate;
else
exe.bufferReference = pBufferHdr->pInputPortPrivate;
exe.func = port->func;
exe.inputPrivate = NULL;
exe.outputPrivate = NULL;
if(ilcs_execute_function(st->ilcs, IL_FREE_BUFFER, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
if (resp.err == OMX_ErrorNone)
{
if (port->func == IL_ALLOCATE_BUFFER)
vcos_free(pBufferHdr->pBuffer);
vcos_free(pBufferHdr);
port->numBuffers--;
}
return resp.err;
}
// Called on host-side to pass a buffer to VideoCore to be emptied
static OMX_ERRORTYPE vcil_out_EmptyThisBuffer(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
ILCS_COMMON_T *st;
if (!(pComp && pBuffer))
return (OMX_ErrorBadParameter);
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
return ilcs_pass_buffer(st->ilcs, IL_EMPTY_THIS_BUFFER, comp->reference, pBuffer);
}
// Called from ril_top as OMX_FillThisBuffer().
// ->pBuffer field is expected to be a memory handle.
static OMX_ERRORTYPE vcil_out_FillThisBuffer(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
{
OMX_ERRORTYPE err;
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
VC_PRIVATE_PORT_T *port;
ILCS_COMMON_T *st;
if (!(pComp && pBuffer))
return (OMX_ErrorBadParameter);
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
port = find_port(comp, pBuffer->nOutputPortIndex);
if(!port)
return OMX_ErrorBadPortIndex;
if(pBuffer->pBuffer == 0)
return OMX_ErrorIncorrectStateOperation;
vcos_assert(pComp != NULL && comp != NULL && port != NULL && st != NULL);
// The lower layers will attempt to transfer the bytes specified if we don't
// clear these - callers should ideally do this themselves, but it is not
// mandated in the specification.
pBuffer->nFilledLen = 0;
pBuffer->nFlags = 0;
vc_assert(port->bEGL == OMX_TRUE || is_valid_hostside_buffer(pBuffer));
err = ilcs_pass_buffer(st->ilcs, IL_FILL_THIS_BUFFER, comp->reference, pBuffer);
if (err == OMX_ErrorNone && port->bEGL == OMX_TRUE)
{
// If an output port is marked as an EGL port, we request EGL to notify the IL component
// when it's allowed to render into the buffer/EGLImage.
vc_assert(local_eglIntOpenMAXILDoneMarker != NULL);
local_eglIntOpenMAXILDoneMarker(comp->reference, pBuffer->pBuffer);
}
return err;
}
static OMX_ERRORTYPE vcil_out_ComponentTunnelRequest(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_U32 nPort,
OMX_IN OMX_HANDLETYPE hTunneledComp,
OMX_IN OMX_U32 nTunneledPort,
OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_TUNNEL_REQUEST_EXECUTE_T exe;
IL_TUNNEL_REQUEST_RESPONSE_T resp;
VC_PRIVATE_COMPONENT_T *list;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if(!pComp)
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
exe.reference = comp->reference;
exe.port = nPort;
exe.tunnel_port = nTunneledPort;
if (pTunnelSetup)
exe.setup = *pTunnelSetup;
// the other component may be on the host or on VC. Look through our list
// so we can tell, and tell ILCS on VC the details.
vcos_semaphore_wait(&st->component_lock);
list = st->component_list;
while (list != NULL && list->comp != (void *) hTunneledComp)
list = list->next;
vcos_semaphore_post(&st->component_lock);
if (list == NULL)
{
exe.tunnel_ref = hTunneledComp;
exe.tunnel_host = OMX_TRUE;
}
else
{
exe.tunnel_ref = list->reference;
exe.tunnel_host = OMX_FALSE;
}
if(ilcs_execute_function(st->ilcs, IL_COMPONENT_TUNNEL_REQUEST, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
if (pTunnelSetup)
*pTunnelSetup = resp.setup;
return resp.err;
}
static OMX_ERRORTYPE vcil_out_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_STRING cParameterName,
OMX_OUT OMX_INDEXTYPE* pIndexType)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp;
IL_GET_EXTENSION_EXECUTE_T exe;
IL_GET_EXTENSION_RESPONSE_T resp;
ILCS_COMMON_T *st;
int rlen = sizeof(resp);
if (!(pComp && cParameterName && pIndexType))
return OMX_ErrorBadParameter;
st = pComp->pApplicationPrivate;
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
exe.reference = comp->reference;
strncpy(exe.name, cParameterName, 128);
exe.name[127] = 0;
if(ilcs_execute_function(st->ilcs, IL_GET_EXTENSION_INDEX, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
*pIndexType = resp.index;
return resp.err;
}
static OMX_ERRORTYPE vcil_out_ComponentRoleEnum(OMX_IN OMX_HANDLETYPE hComponent,
OMX_OUT OMX_U8 *cRole,
OMX_IN OMX_U32 nIndex)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
VC_PRIVATE_COMPONENT_T *comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
IL_COMPONENT_ROLE_ENUM_EXECUTE_T exe;
IL_COMPONENT_ROLE_ENUM_RESPONSE_T resp;
ILCS_COMMON_T *st = pComp->pApplicationPrivate;
int rlen = sizeof(resp);
exe.reference = comp->reference;
exe.index = nIndex;
if(ilcs_execute_function(st->ilcs, IL_COMPONENT_ROLE_ENUM, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
strncpy((char *) cRole, (char *) resp.role, 128);
cRole[127] = 0;
return resp.err;
}
OMX_ERRORTYPE vcil_out_component_name_enum(ILCS_COMMON_T *st, OMX_STRING cComponentName, OMX_U32 nNameLength, OMX_U32 nIndex)
{
IL_COMPONENT_NAME_ENUM_EXECUTE_T exe;
IL_COMPONENT_NAME_ENUM_RESPONSE_T resp;
int rlen = sizeof(resp);
exe.index = nIndex;
if(ilcs_execute_function(st->ilcs, IL_COMPONENT_NAME_ENUM, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
if (sizeof(resp.name) < nNameLength)
nNameLength = sizeof(resp.name);
strncpy((char *)cComponentName, (char *) resp.name, nNameLength);
cComponentName[127] = 0;
return resp.err;
}
OMX_ERRORTYPE vcil_out_get_debug_information(ILCS_COMMON_T *st, OMX_STRING debugInfo, OMX_S32 *pLen)
{
IL_GET_DEBUG_INFORMATION_EXECUTE_T exe;
exe.len = *pLen;
if(ilcs_execute_function(st->ilcs, IL_GET_DEBUG_INFORMATION, &exe, sizeof(exe), debugInfo, (int *) pLen) < 0)
return OMX_ErrorHardware;
return OMX_ErrorNone;
}
// Called on the host side to create an OMX component.
OMX_ERRORTYPE vcil_out_create_component(ILCS_COMMON_T *st, OMX_HANDLETYPE hComponent, OMX_STRING component_name)
{
OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
IL_CREATE_COMPONENT_EXECUTE_T exe;
IL_CREATE_COMPONENT_RESPONSE_T resp;
VC_PRIVATE_COMPONENT_T *comp;
OMX_U32 i;
int rlen = sizeof(resp);
if (strlen(component_name) >= sizeof(exe.name))
return OMX_ErrorInvalidComponent;
strcpy(exe.name, component_name);
exe.mark = pComp;
if(ilcs_execute_function(st->ilcs, IL_CREATE_COMPONENT, &exe, sizeof(exe), &resp, &rlen) < 0 || rlen != sizeof(resp))
return OMX_ErrorHardware;
if (resp.err != OMX_ErrorNone)
return resp.err;
comp = vcos_malloc(sizeof(VC_PRIVATE_COMPONENT_T) + (sizeof(VC_PRIVATE_PORT_T) * resp.numPorts), "ILCS Host Comp");
if (!comp)
{
IL_EXECUTE_HEADER_T dexe;
IL_RESPONSE_HEADER_T dresp;
int dlen = sizeof(dresp);
dexe.reference = resp.reference;
ilcs_execute_function(st->ilcs, IL_COMPONENT_DEINIT, &dexe, sizeof(dexe), &dresp, &dlen);
return OMX_ErrorInsufficientResources;
}
memset(comp, 0, sizeof(VC_PRIVATE_COMPONENT_T) + (sizeof(VC_PRIVATE_PORT_T) * resp.numPorts));
comp->reference = resp.reference;
comp->comp = pComp;
comp->numPorts = resp.numPorts;
comp->port = (VC_PRIVATE_PORT_T *) ((unsigned char *) comp + sizeof(VC_PRIVATE_COMPONENT_T));
for (i=0; i<comp->numPorts; i++)
{
if (i && !(i&0x1f))
{
IL_GET_EXECUTE_T gexe;
IL_GET_RESPONSE_T gresp;
OMX_PARAM_PORTSUMMARYTYPE *summary;
int glen = sizeof(gresp);
gexe.reference = comp->reference;
gexe.index = OMX_IndexParamPortSummary;
summary = (OMX_PARAM_PORTSUMMARYTYPE *) &gexe.param;
summary->nSize = sizeof(OMX_PARAM_PORTSUMMARYTYPE);
summary->nVersion.nVersion = OMX_VERSION;
summary->reqSet = i>>5;
ilcs_execute_function(st->ilcs, IL_GET_PARAMETER, &gexe,
sizeof(OMX_PARAM_PORTSUMMARYTYPE)+IL_GET_EXECUTE_HEADER_SIZE,
&gresp, &glen);
summary = (OMX_PARAM_PORTSUMMARYTYPE *) &gresp.param;
resp.portDir = summary->portDir;
memcpy(resp.portIndex, summary->portIndex, sizeof(OMX_U32) * 32);
}
comp->port[i].port = resp.portIndex[i&0x1f];
comp->port[i].dir = ((resp.portDir >> (i&0x1f)) & 1) ? OMX_DirOutput : OMX_DirInput;
}
vcos_semaphore_wait(&st->component_lock);
// insert into head of list
comp->next = st->component_list;
st->component_list = comp;
vcos_semaphore_post(&st->component_lock);
pComp->pComponentPrivate = comp;
pComp->pApplicationPrivate = st;
pComp->GetComponentVersion = vcil_out_GetComponentVersion;
pComp->ComponentDeInit = vcil_out_ComponentDeInit;
pComp->SetCallbacks = vcil_out_SetCallbacks;
pComp->GetState = vcil_out_GetState;
pComp->GetParameter = vcil_out_GetParameter;
pComp->SetParameter = vcil_out_SetParameter;
pComp->GetConfig = vcil_out_GetConfig;
pComp->SetConfig = vcil_out_SetConfig;
pComp->SendCommand = vcil_out_SendCommand;
pComp->UseBuffer = vcil_out_UseBuffer;
pComp->AllocateBuffer = vcil_out_AllocateBuffer;
pComp->FreeBuffer = vcil_out_FreeBuffer;
pComp->EmptyThisBuffer = vcil_out_EmptyThisBuffer;
pComp->FillThisBuffer = vcil_out_FillThisBuffer;
pComp->ComponentTunnelRequest = vcil_out_ComponentTunnelRequest;
pComp->GetExtensionIndex = vcil_out_GetExtensionIndex;
pComp->UseEGLImage = vcil_out_UseEGLImage;
pComp->ComponentRoleEnum = vcil_out_ComponentRoleEnum;
return resp.err;
}
/* callbacks */
void vcil_out_event_handler(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_EVENT_HANDLER_EXECUTE_T *exe = call;
OMX_COMPONENTTYPE *pComp = exe->reference;
VC_PRIVATE_COMPONENT_T *comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
*rlen = 0;
vcos_assert(comp->callbacks.EventHandler);
comp->callbacks.EventHandler(pComp, comp->callback_state, exe->event, exe->data1, exe->data2, exe->eventdata);
}
// Called on host side via RPC in response to empty buffer completing
void vcil_out_empty_buffer_done(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_PASS_BUFFER_EXECUTE_T *exe = call;
OMX_COMPONENTTYPE *pComp = exe->reference;
VC_PRIVATE_COMPONENT_T *comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
OMX_BUFFERHEADERTYPE *pHeader = exe->bufferHeader.pOutputPortPrivate;
OMX_U8 *pBuffer = pHeader->pBuffer;
OMX_PTR *pAppPrivate = pHeader->pAppPrivate;
OMX_PTR *pPlatformPrivate = pHeader->pPlatformPrivate;
OMX_PTR *pInputPortPrivate = pHeader->pInputPortPrivate;
OMX_PTR *pOutputPortPrivate = pHeader->pOutputPortPrivate;
memcpy(pHeader, &exe->bufferHeader, sizeof(OMX_BUFFERHEADERTYPE));
pHeader->pBuffer = pBuffer;
pHeader->pAppPrivate = pAppPrivate;
pHeader->pPlatformPrivate = pPlatformPrivate;
pHeader->pInputPortPrivate = pInputPortPrivate;
pHeader->pOutputPortPrivate = pOutputPortPrivate;
*rlen = 0;
vcos_assert(comp->callbacks.EmptyBufferDone);
comp->callbacks.EmptyBufferDone(pComp, comp->callback_state, pHeader);
}
// Called on host side via RPC in response to a fill-buffer completing
// on the VideoCore side. ->pBuffer is a real pointer.
void vcil_out_fill_buffer_done(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
OMX_COMPONENTTYPE *pComp;
VC_PRIVATE_COMPONENT_T *comp;
OMX_BUFFERHEADERTYPE *pHeader;
pHeader = ilcs_receive_buffer(st->ilcs, call, clen, &pComp);
*rlen = 0;
if(pHeader)
{
comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
vc_assert(comp->callbacks.FillBufferDone);
comp->callbacks.FillBufferDone(pComp, comp->callback_state, pHeader);
}
}
|
84f5ba43810e942970700c2b29cef97ce110ab47
|
f8cc1dd4b1378490386def2e0571561fab10b275
|
/src/libstddjb/buffer_putsall.c
|
bcbb8b3d935e5ac5a546fa4a618aea83c3291ee5
|
[
"ISC"
] |
permissive
|
skarnet/skalibs
|
b1eb2a0e38663cbfa918ee0a7916f56227bd7c2d
|
1f2d5f95684e93f8523e369ef1fed7a75c444082
|
refs/heads/master
| 2023-08-23T07:33:20.996016
| 2023-08-08T09:39:15
| 2023-08-08T09:39:15
| 31,461,366
| 104
| 32
|
ISC
| 2021-04-11T10:10:54
| 2015-02-28T12:01:41
|
C
|
UTF-8
|
C
| false
| false
| 175
|
c
|
buffer_putsall.c
|
/* ISC license. */
#include <string.h>
#include <skalibs/buffer.h>
int buffer_putsall (buffer *b, char const *s, size_t *w)
{
return buffer_putall(b, s, strlen(s), w) ;
}
|
6092827f0eb5f3c784b6a1da04df8d26918b01c5
|
0744dcc5394cebf57ebcba343747af6871b67017
|
/os/board/rtl8730e/src/component/soc/amebad2/atf/include/drivers/renesas/rcar/console/console.h
|
7d5b5d3ceb50e4b7cf8d4b7eb74d3efadde11024
|
[
"GPL-1.0-or-later",
"BSD-3-Clause",
"ISC",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive",
"Apache-2.0"
] |
permissive
|
Samsung/TizenRT
|
96abf62f1853f61fcf91ff14671a5e0c6ca48fdb
|
1a5c2e00a4b1bbf4c505bbf5cc6a8259e926f686
|
refs/heads/master
| 2023-08-31T08:59:33.327998
| 2023-08-08T06:09:20
| 2023-08-31T04:38:20
| 82,517,252
| 590
| 719
|
Apache-2.0
| 2023-09-14T06:54:49
| 2017-02-20T04:38:30
|
C
|
UTF-8
|
C
| false
| false
| 670
|
h
|
console.h
|
/*
* Copyright (c) 2015-2019, Renesas Electronics Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef RCAR_PRINTF_H
#define RCAR_PRINTF_H
#ifndef __ASSEMBLER__
#include <stdint.h>
/*
* Initialize a new rcar console instance and register it with the console
* framework. The |console| pointer must point to storage that will be valid
* for the lifetime of the console, such as a global or static local variable.
* Its contents will be reinitialized from scratch.
*/
int console_rcar_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
console_t *console);
#endif /*__ASSEMBLER__*/
#endif /* RCAR_PRINTF_H */
|
7a5ceac2b3a9e665c19f3129a59a769f1278582e
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/u-boot_new/arch/sparc/include/asm/atomic.h
|
35236d01f8d056ba43b224891d27daa33c2ce4b8
|
[
"GPL-2.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 249
|
h
|
atomic.h
|
/* SPARC atomic operations
*
* (C) Copyright 2008
* Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef _ASM_SPARC_ATOMIC_H_
#define _ASM_SPARC_ATOMIC_H_
#endif /* _ASM_SPARC_ATOMIC_H_ */
|
6b29976d8a662f2956b04e83a517fcd4fee8a9fa
|
6ff85b80c6fe1b3ad5416a304b93551a5e80de10
|
/C/String/StringTerminator.c
|
ac67f402d458c3ae6008ab7705e0835b9fd2784d
|
[
"MIT"
] |
permissive
|
maniero/SOpt
|
c600cc2333e0a47ce013be3516bbb8080502ff2a
|
5d17e1a9cbf115eaea6d30af2079d0c92ffff7a3
|
refs/heads/master
| 2023-08-10T16:48:46.058739
| 2023-08-10T13:42:17
| 2023-08-10T13:42:17
| 78,631,930
| 1,002
| 136
|
MIT
| 2023-01-28T12:10:01
| 2017-01-11T11:19:24
|
C#
|
UTF-8
|
C
| false
| false
| 440
|
c
|
StringTerminator.c
|
#include <stdio.h>
#include <string.h>
int main(void) {
char texto[50];
printf("\nInforme seu nome completo: ");
fgets(texto, 50, stdin);
int cont = strlen(texto);
printf("\nO tamanho da string: %i\n", cont);
for (int i = 0; i < cont; i++) printf("%d ", texto[i]);
texto[cont - 1] = '\0';
cont = strlen(texto);
printf("\nO tamanho da string: %i\n", cont);
}
//https://pt.stackoverflow.com/q/157168/101
|
00e2fa6e8c20014207ee5da771cca5b06ee72682
|
010279e2ba272d09e9d2c4e903722e5faba2cf7a
|
/contrib/tools/cython/Cython/Utility/CommonStructures.c
|
c7945feb49caffd990b9d58108586a4132e6c3c2
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
catboost/catboost
|
854c1a1f439a96f1ae6b48e16644be20aa04dba2
|
f5042e35b945aded77b23470ead62d7eacefde92
|
refs/heads/master
| 2023-09-01T12:14:14.174108
| 2023-09-01T10:01:01
| 2023-09-01T10:22:12
| 97,556,265
| 8,012
| 1,425
|
Apache-2.0
| 2023-09-11T03:32:32
| 2017-07-18T05:29:04
|
Python
|
UTF-8
|
C
| false
| false
| 2,558
|
c
|
CommonStructures.c
|
/////////////// FetchCommonType.proto ///////////////
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
/////////////// FetchCommonType ///////////////
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* fake_module;
PyTypeObject* cached_type = NULL;
fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
if (!fake_module) return NULL;
Py_INCREF(fake_module);
cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
if (cached_type) {
if (!PyType_Check((PyObject*)cached_type)) {
PyErr_Format(PyExc_TypeError,
"Shared Cython type %.200s is not a type object",
type->tp_name);
goto bad;
}
if (cached_type->tp_basicsize != type->tp_basicsize) {
PyErr_Format(PyExc_TypeError,
"Shared Cython type %.200s has the wrong size, try recompiling",
type->tp_name);
goto bad;
}
} else {
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
PyErr_Clear();
if (PyType_Ready(type) < 0) goto bad;
if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
goto bad;
Py_INCREF(type);
cached_type = type;
}
done:
Py_DECREF(fake_module);
// NOTE: always returns owned reference, or NULL on error
return cached_type;
bad:
Py_XDECREF(cached_type);
cached_type = NULL;
goto done;
}
/////////////// FetchCommonPointer.proto ///////////////
static void* __Pyx_FetchCommonPointer(void* pointer, const char* name);
/////////////// FetchCommonPointer ///////////////
static void* __Pyx_FetchCommonPointer(void* pointer, const char* name) {
#if PY_VERSION_HEX >= 0x02070000
PyObject* fake_module = NULL;
PyObject* capsule = NULL;
void* value = NULL;
fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
if (!fake_module) return NULL;
Py_INCREF(fake_module);
capsule = PyObject_GetAttrString(fake_module, name);
if (!capsule) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
PyErr_Clear();
capsule = PyCapsule_New(pointer, name, NULL);
if (!capsule) goto bad;
if (PyObject_SetAttrString(fake_module, name, capsule) < 0)
goto bad;
}
value = PyCapsule_GetPointer(capsule, name);
bad:
Py_XDECREF(capsule);
Py_DECREF(fake_module);
return value;
#else
return pointer;
#endif
}
|
4db098683ceab96183cd70bbe2562d100a14d512
|
e73547787354afd9b717ea57fe8dd0695d161821
|
/src/world/area_iwa/iwa_03/iwa_03_1_main.c
|
709dbf835c60057d6e792b183b29aca3cece609d
|
[] |
no_license
|
pmret/papermario
|
8b514b19653cef8d6145e47499b3636b8c474a37
|
9774b26d93f1045dd2a67e502b6efc9599fb6c31
|
refs/heads/main
| 2023-08-31T07:09:48.951514
| 2023-08-21T18:07:08
| 2023-08-21T18:07:08
| 287,151,133
| 904
| 139
| null | 2023-09-14T02:44:23
| 2020-08-13T01:22:57
|
C
|
UTF-8
|
C
| false
| false
| 861
|
c
|
iwa_03_1_main.c
|
#include "iwa_03.h"
EvtScript N(EVS_ExitWalk_iwa_01_1) = EVT_EXIT_WALK(60, iwa_03_ENTRY_0, "iwa_01", iwa_01_ENTRY_1);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_iwa_01_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili1, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_MT_RUGGED)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_EXEC(N(EVS_BindSlideTriggers))
EVT_CALL(SetMusicTrack, 0, SONG_MT_RUGGED, 0, 8)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_WAIT(1)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_patapata, COLLIDER_FLAGS_UPPER_MASK)
EVT_RETURN
EVT_END
};
|
444077c1090af886d99013693ab1edda50813a85
|
4ba76056c744ada0a01fb27b7cad8464cefc7aa0
|
/supports/toolchains/LiveEditor/PainterEngine_Resource_eye_no_traw.h
|
7aea1a88e7a8e60dcee9750d21fa7624f0795d7d
|
[
"BSD-3-Clause"
] |
permissive
|
matrixcascade/PainterEngine
|
23e110e25a39e1d016ed7936eac23e06932456b4
|
1d3e6e85f337e8a8db44680094ab3f4b988507cb
|
refs/heads/master
| 2023-08-29T11:29:26.934779
| 2023-08-23T09:23:04
| 2023-08-23T09:23:04
| 190,119,926
| 1,989
| 253
|
BSD-3-Clause
| 2023-09-05T12:19:31
| 2019-06-04T03:08:26
|
C
|
UTF-8
|
C
| false
| false
| 4,060
|
h
|
PainterEngine_Resource_eye_no_traw.h
|
static char const eye_no_traw[]={0x54,0x52,0x41,0x57,0x10,0x0,0x0,0x0,0xf,0x0,0x0,0x0,0x0,0x0,0x0,0xb,0x0,0x0,0x0,0x45,0x0,0x0,0x0,0x17,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0xf3,0x0,0x0,0x0,0xcb,0x0,0x0,0x0,0x1d,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9f,0x0,0x0,0x0,0xfd,0x0,0x0,0x0,0xd5,0x0,0x0,0x0,0x1e,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x8d,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xe3,0x0,0x0,0x0,0x82,0x0,0x0,0x0,0x1c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8a,0x0,0x0,0x0,0xfc,0x0,0x0,0x0,0xe8,0x0,0x0,0x0,0xb8,0x0,0x0,0x0,0xee,0x0,0x0,0x0,0xe3,0x0,0x0,0x0,0xd6,0x0,0x0,0x0,0xf9,0x0,0x0,0x0,0xf5,0x0,0x0,0x0,0x97,0x0,0x0,0x0,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xd,0x0,0x0,0x0,0xcc,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xfe,0x0,0x0,0x0,0x71,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0x26,0x0,0x0,0x0,0xa5,0x0,0x0,0x0,0xf6,0x0,0x0,0x0,0xde,0x0,0x0,0x0,0x3a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xb,0x0,0x0,0x0,0xa7,0x0,0x0,0x0,0xf4,0x0,0x0,0x0,0xe6,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0xf5,0x0,0x0,0x0,0x78,0x0,0x0,0x0,0x38,0x0,0x0,0x0,0x52,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x53,0x0,0x0,0x0,0xea,0x0,0x0,0x0,0xdd,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x7f,0x0,0x0,0x0,0xf7,0x0,0x0,0x0,0x90,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0xaa,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xf9,0x0,0x0,0x0,0xe2,0x0,0x0,0x0,0xd2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x49,0x0,0x0,0x0,0xef,0x0,0x0,0x0,0xc9,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x22,0x0,0x0,0x0,0xea,0x0,0x0,0x0,0xdf,0x0,0x0,0x0,0x5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8b,0x0,0x0,0x0,0xe5,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xfe,0x0,0x0,0x0,0xe8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xb1,0x0,0x0,0x0,0xfd,0x0,0x0,0x0,0x4c,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0xb9,0x0,0x0,0x0,0xf3,0x0,0x0,0x0,0x4e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5b,0x0,0x0,0x0,0xe4,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xf6,0x0,0x0,0x0,0x3f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5b,0x0,0x0,0x0,0xfc,0x0,0x0,0x0,0xd9,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xb,0x0,0x0,0x0,0xdb,0x0,0x0,0x0,0xef,0x0,0x0,0x0,0x4e,0x0,0x0,0x0,0xa,0x0,0x0,0x0,0x7f,0x0,0x0,0x0,0xd7,0x0,0x0,0x0,0xe2,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0xf6,0x0,0x0,0x0,0x29,0x0,0x0,0x0,0xc0,0x0,0x0,0x0,0xe8,0x0,0x0,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x23,0x0,0x0,0x0,0xd5,0x0,0x0,0x0,0xf6,0x0,0x0,0x0,0x94,0x0,0x0,0x0,0x25,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x1e,0x0,0x0,0x0,0x6a,0x0,0x0,0x0,0xfe,0x0,0x0,0x0,0xfb,0x0,0x0,0x0,0xae,0x0,0x0,0x0,0x11,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0xa4,0x0,0x0,0x0,0xf5,0x0,0x0,0x0,0xee,0x0,0x0,0x0,0xcd,0x0,0x0,0x0,0xd2,0x0,0x0,0x0,0xf7,0x0,0x0,0x0,0xf3,0x0,0x0,0x0,0xfc,0x0,0x0,0x0,0xea,0x0,0x0,0x0,0x30,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x0,0x0,0xae,0x0,0x0,0x0,0xda,0x0,0x0,0x0,0xd6,0x0,0x0,0x0,0x7e,0x0,0x0,0x0,0x1b,0x0,0x0,0x0,0x5e,0x0,0x0,0x0,0xfa,0x0,0x0,0x0,0xed,0x0,0x0,0x0,0x34,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x57,0x0,0x0,0x0,0xfa,0x0,0x0,0x0,0xd8,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0xa1,0x0,0x0,0x0,0x0,0x0,};
|
6855382c4dd37a964dfabfd042822eeee3dcf483
|
e65a4dbfbfb0e54e59787ba7741efee12f7687f3
|
/science/openmx/files/patch-Band__DFT__Col.c
|
a22e95c8e542ae2e9c68268288bd33f969c80082
|
[
"BSD-2-Clause"
] |
permissive
|
freebsd/freebsd-ports
|
86f2e89d43913412c4f6b2be3e255bc0945eac12
|
605a2983f245ac63f5420e023e7dce56898ad801
|
refs/heads/main
| 2023-08-30T21:46:28.720924
| 2023-08-30T19:33:44
| 2023-08-30T19:33:44
| 1,803,961
| 916
| 918
|
NOASSERTION
| 2023-09-08T04:06:26
| 2011-05-26T11:15:35
| null |
UTF-8
|
C
| false
| false
| 636
|
c
|
patch-Band__DFT__Col.c
|
--- Band_DFT_Col.c.orig 2018-08-29 06:24:38 UTC
+++ Band_DFT_Col.c
@@ -483,9 +483,9 @@ double Band_DFT_Col(int SCF_iter,
/* allocation */
- stat_send = malloc(sizeof(MPI_Status)*numprocs2);
- request_send = malloc(sizeof(MPI_Request)*numprocs2);
- request_recv = malloc(sizeof(MPI_Request)*numprocs2);
+ stat_send = (MPI_Status *)malloc(sizeof(MPI_Status)*numprocs2);
+ request_send = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs2);
+ request_recv = (MPI_Request *)malloc(sizeof(MPI_Request)*numprocs2);
is1 = (int*)malloc(sizeof(int)*numprocs2);
ie1 = (int*)malloc(sizeof(int)*numprocs2);
|
7ded05fca99f24074e591dba71a7442adecd15c9
|
b0f08154e3eebc7d8465efc57597e52d08d69c18
|
/src/base/environment_variable.c
|
54f87a0e098d0e2408b840d1d1a7b6607ef6b5a8
|
[
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
CUBRID/cubrid
|
8f71a0010243b72e43ba887d229210650f4e901e
|
3b952af33230839a1b561a78ecd4b773374b66f8
|
refs/heads/develop
| 2023-08-18T19:16:30.987583
| 2023-08-18T08:18:05
| 2023-08-18T08:18:05
| 52,080,367
| 287
| 294
|
NOASSERTION
| 2023-09-14T21:29:09
| 2016-02-19T10:25:32
|
C
|
UTF-8
|
C
| false
| false
| 13,709
|
c
|
environment_variable.c
|
/*
* Copyright 2008 Search Solution Corporation
* Copyright 2016 CUBRID Corporation
*
* 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.
*
*/
/*
* environment_variable.c : Functions for manipulating the environment variable
*/
#ident "$Id$"
#include "config.h"
#include <stdlib.h>
#include <errno.h>
#include <ctype.h>
#include <assert.h>
#include "porting.h"
#include "error_code.h"
#include "environment_variable.h"
/* available root directory symbols; NULL terminated array */
static const char envvar_Prefix_name[] = "CUBRID";
static const char *envvar_Prefix = NULL;
static const char *envvar_Root = NULL;
#define _ENVVAR_MAX_LENGTH 255
typedef enum
{
ENV_INVALID_DIR,
ENV_DONT_EXISTS_ROOT,
ENV_MUST_ABS_PATH,
ENV_TOO_LONG
} ENV_ERR_MSG;
static const char *env_msg[] = {
"The directory in $%s is invalid. (%s)\n",
"The root directory environment variable $%s is not set.\n",
"The $%s should be an absolute path. (%s)\n",
"The $%s is too long. (%s)\n"
};
static void
envvar_check_environment (void)
{
#if defined(WINDOWS)
return;
#else
const char *cubrid_tmp = envvar_get ("TMP");
if (cubrid_tmp)
{
char name[_ENVVAR_MAX_LENGTH];
size_t len = strlen (cubrid_tmp);
size_t limit = 108 - 12;
/* 108 = sizeof (((struct sockaddr_un *) 0)->sun_path) */
/* 12 = ("CUBRID65384" + 1) */
envvar_name (name, _ENVVAR_MAX_LENGTH, "TMP");
if (!IS_ABS_PATH (cubrid_tmp))
{
fprintf (stderr, env_msg[ENV_MUST_ABS_PATH], name, cubrid_tmp);
fflush (stderr);
exit (1);
}
if (len > limit)
{
fprintf (stderr, env_msg[ENV_TOO_LONG], name, cubrid_tmp);
fflush (stderr);
exit (1);
}
}
#endif
}
/*
* envvar_prefix - find a recognized prefix symbol
* return: prefix symbol
*/
const char *
envvar_prefix (void)
{
if (!envvar_Prefix)
{
#if !defined (DO_NOT_USE_CUBRIDENV)
envvar_Root = getenv (envvar_Prefix_name);
if (envvar_Root != NULL)
{
#if !defined (WINDOWS)
if (access (envvar_Root, F_OK) != 0)
{
fprintf (stderr, env_msg[ENV_INVALID_DIR], envvar_Prefix_name, envvar_Root);
fflush (stderr);
exit (1);
}
#endif
envvar_Prefix = envvar_Prefix_name;
}
else
{
fprintf (stderr, env_msg[ENV_DONT_EXISTS_ROOT], envvar_Prefix_name);
fflush (stderr);
exit (1);
}
envvar_check_environment ();
#else
envvar_Prefix = envvar_Prefix_name;
envvar_Root = CUBRID_PREFIXDIR;
#endif
}
return envvar_Prefix;
}
/*
* envvar_root - get value of the root directory environment variable
* return: root directory
*/
const char *
envvar_root (void)
{
if (envvar_Root == NULL)
{
envvar_prefix ();
}
return envvar_Root;
}
/*
* envvar_name - add the prefix symbol to an environment variable name
* return: prefixed name
* buf(out): string buffer to store the prefixed name
* size(out): size of the buffer
* name(in): an environment variable name
*/
const char *
envvar_name (char *buf, size_t size, const char *name)
{
const char *prefix;
char *pname;
pname = buf;
prefix = envvar_prefix ();
while (size > 1 && *prefix)
{
*pname++ = *prefix++;
size--;
}
if (size > 1)
{
*pname++ = '_';
size--;
}
while (size > 1 && *name)
{
*pname++ = *name++;
size--;
}
*pname = '\0';
return buf;
}
/*
* envvar_get - get value of an prefixed environment variable
* return: a string containing the value for the specified environment
* variable
* name(in): environment variable name without prefix
*
* Note: the prefix symbol will be added to the name
*/
const char *
envvar_get (const char *name)
{
char buf[_ENVVAR_MAX_LENGTH];
return getenv (envvar_name (buf, _ENVVAR_MAX_LENGTH, name));
}
/*
* enclosing_method - change value of an prefixed environment variable
* return: error code
* name(in): environment variable name without prefix
* val(in): the value to be set to the environment variable
*
* Note: the prefix symbol will be added to the name
*/
int
envvar_set (const char *name, const char *val)
{
char buf[_ENVVAR_MAX_LENGTH];
int ret;
envvar_name (buf, _ENVVAR_MAX_LENGTH, name);
ret = setenv (buf, val, 1);
if (ret != 0)
{
return ER_FAILED;
}
return NO_ERROR;
}
/*
* envvar_expand - expand environment variables (${ENV}) with their values
* within the string
* return: error code
* string(in): string containing environment variables
* buffer(out): output buffer
* maxlen(in): maximum length of output buffer
*
* Note:
* The environment variables must be prefixed with a '$' and are
* enclosed by '{' and '}' or terminated by a non alpha numeric character
* except for '_'.
* If all of the referenced environment variables were expanded,
* NO_ERROR is returned. If a reference could not be expanded, the output
* buffer will contain the name of the unresolved variable.
* This function can handle up to 10 environment variables. It is an error
* if exceeds.
*/
int
envvar_expand (const char *string, char *buffer, size_t maxlen)
{
#define _ENVVAR_MAX_EXPANSION (10 * 2 + 1)
struct _fragment
{
const char *str;
size_t len;
} fragments[_ENVVAR_MAX_EXPANSION], *cur, *fen;
char env[_ENVVAR_MAX_LENGTH], *val;
const char *s, *e;
s = strchr (string, '$');
if (!s)
{
/* no environment variable in the string */
(void) strlcpy (buffer, string, maxlen);
return NO_ERROR;
}
cur = fragments;
fen = fragments + _ENVVAR_MAX_EXPANSION;
do
{
env[0] = '\0';
if (s[1] == '{')
{
for (e = s + 1; *e && *e != '}'; e++)
;
if (*e && (e - s - 2) < _ENVVAR_MAX_LENGTH)
{
/* ${ENV}; copy the name of the environment variable */
(void) strlcpy (env, s + 2, e - s - 1);
e++;
}
}
else
{
for (e = s + 1; *e && (isalnum (*e) || *e == '_'); e++)
;
if ((e - s - 1) < _ENVVAR_MAX_LENGTH)
{
/* $ENV; copy the name of the environment variable */
(void) strlcpy (env, s + 1, e - s);
}
}
if (env[0])
{
/* a environment variable is referred; get the value */
val = getenv (env);
if (!val)
{
/* error */
(void) strlcpy (buffer, env, maxlen);
return ER_FAILED;
}
if (s > string)
{
/* a fragment */
cur->str = string;
cur->len = s - string;
if (++cur > fen)
{
/* error */
*buffer = '\0';
return ER_FAILED;
}
}
/* a fragment of the value */
cur->str = val;
cur->len = strlen (val);
if (++cur > fen)
{
/* error */
*buffer = '\0';
return ER_FAILED;
}
}
else
{
cur->str = string;
cur->len = e - string;
if (++cur > fen)
{
/* error */
*buffer = '\0';
return ER_FAILED;
}
}
string = e;
s = strchr (string, '$');
}
while (s);
if (*string)
{
cur->str = string;
cur->len = strlen (string);
cur++;
}
cur->str = NULL;
cur->len = 0;
/* assemble fragments */
for (cur = fragments; cur->len && maxlen > 1; cur++)
{
if (cur->len >= maxlen)
{
cur->len = maxlen - 1;
}
(void) memcpy (buffer, cur->str, cur->len);
buffer += cur->len;
maxlen -= cur->len;
}
*buffer = '\0';
return NO_ERROR;
}
char *
envvar_bindir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/bin/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_BINDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_libdir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/lib/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_LIBDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_javadir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/java/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_JAVADIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_localedir_file (char *path, size_t size, const char *langpath, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/msg/%s/%s", envvar_Root, langpath, filename);
#else
snprintf (path, size, "%s/%s/%s", CUBRID_LOCALEDIR, langpath, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_confdir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/conf/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_CONFDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_vardir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/var/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_VARDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_tmpdir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/tmp/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_TMPDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_logdir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/log/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_LOGDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
void
envvar_trim_char (char *env_val, const int c)
{
char *buf;
size_t size;
if (env_val == NULL)
{
return;
}
size = strlen (env_val);
if (*env_val == c && size > 2)
{
buf = (char *) malloc (1 + size);
if (buf != NULL)
{
strcpy (buf, env_val);
strncpy (env_val, buf + 1, size - 2);
env_val[size - 2] = '\0';
free (buf);
}
}
}
char *
envvar_ldmldir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/locales/data/ldml/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_CONFDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_codepagedir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/locales/data/codepages/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_CONFDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_localedatadir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/locales/data/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_CONFDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_loclib_dir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/locales/loclib/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_CONFDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_cubrid_dir (char *path, size_t size)
{
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s", envvar_Root);
#else
snprintf (path, size, "%s", CUBRID_CONFDIR);
#endif
path[size - 1] = '\0';
return path;
}
char *
envvar_tzdata_dir_file (char *path, size_t size, const char *filename)
{
assert (filename != NULL);
#if !defined (DO_NOT_USE_CUBRIDENV)
if (envvar_Root == NULL)
{
envvar_root ();
}
snprintf (path, size, "%s/timezones/tzdata/%s", envvar_Root, filename);
#else
snprintf (path, size, "%s/%s", CUBRID_CONFDIR, filename);
#endif
path[size - 1] = '\0';
return path;
}
|
7cc9ce627d197ee272485e7c4e31b49a0a99da88
|
581731c0a1c166a00d2e18ecf5e73da155fad8d1
|
/tools/sjasm/sjio.h
|
bd80639638103af35adb31b7a6e0e4613d1af870
|
[
"DOC",
"Zlib"
] |
permissive
|
andwn/cave-story-md
|
03e9004ab643574601726c41a851190c1adb25f6
|
2b225269c56dd7877e140f9012f8c233270cf966
|
refs/heads/master
| 2023-06-22T21:33:09.710999
| 2023-06-21T11:52:35
| 2023-06-21T11:52:35
| 32,826,698
| 531
| 47
| null | 2023-04-04T00:36:56
| 2015-03-24T21:39:08
|
C
|
UTF-8
|
C
| false
| false
| 2,114
|
h
|
sjio.h
|
/*
SjASM Z80 Assembler
Copyright (c) 2015 Konamiman
Based on Sjasm 0.39g6 - Copyright (c) 2006 Sjoerd Mastijn
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.
*/
// sjio.h
enum _fouten { ALL, PASS1, PASS2, FATAL, CATCHALL, SUPPRES };
enum Ending { END, ELSE, ENDIF, ENDTEXTAREA, ENDM };
#define str(x) #x
extern aint eadres,epadres;
#define OUTPUT_TRUNCATE 0
#define OUTPUT_REWIND 1
#define OUTPUT_APPEND 2
void OpenDest(int);
void NewDest(char *ndestfilename, int mode);
int FileExists(char* filename);
void error(char*,char*,int=PASS2);
void ListFile();
void ListFileSkip(char*);
void EmitByte(int byte);
void EmitBytes(int *bytes);
void EmitWords(int *words);
void EmitBlock(aint byte, aint lengte);
void OpenFile(char *nfilename);
void Close();
void OpenList();
void OpenDest();
void printhex32(char *&p, aint h);
void BinIncFile(char *fname,int offset,int length);
int ReadLine();
Ending ReadFile();
Ending SkipFile();
void NewDest(char *ndestfilename);
void SeekDest(long,int);
int ReadFileToStringLst(stringlst *&f,char *end);
void WriteExp(char *n, aint v);
void emitarm(aint data);
#ifdef METARM
void emitarmdataproc(int cond, int I,int opcode,int S,int Rn,int Rd,int Op2);
void emitthumb(aint data);
#endif
//eof sjio.h
|
f4d6b1cec67af408bb0339a9bb7d2cf58af0c3d9
|
7f6c235b0598353549959c18f69eefd20b766907
|
/libsrc/target/cpm/graphics/clg.c
|
de743d38d37447f906286c78ffcd3a7b31a0f8b5
|
[
"ClArtistic"
] |
permissive
|
z88dk/z88dk
|
46dfd4905f36d99333173cadd0a660839befc9f0
|
8b07f37cc43c5d9ffe69b563c80763491d8faff7
|
refs/heads/master
| 2023-09-04T19:29:49.254958
| 2023-09-03T20:51:24
| 2023-09-03T20:51:24
| 54,035,569
| 820
| 263
|
NOASSERTION
| 2023-09-05T11:09:04
| 2016-03-16T13:48:16
|
Assembly
|
UTF-8
|
C
| false
| false
| 712
|
c
|
clg.c
|
/*
* CP/M GSX based graphics libraries
*
* clg()
*
* Stefano Bodrato - 2021
*
* $Id: clg.c $
*/
#include <cpm.h>
#include <string.h>
//#include <graphics.h>
extern void __LIB__ clg(void);
extern int gsx_maxx;
extern int gsx_maxy;
extern int gsx_xscale_factor;
extern int gsx_yscale_factor;
/* Clear Graphics */
void clg()
{
gios_ctl.n_ptsin=0;
gios_ctl.n_intin=10;
bzero(gios_intin,20);
//gios_intin[0]=device_id
gios_intin[0]=gios_intin[2]=gios_intin[4]=gios_intin[6]=gios_intin[8]=gios_intin[9]=1;
gios(GSX_OPEN);
gsx_maxx=gios_intout[0];
gsx_maxy=gios_intout[1];
gsx_xscale_factor=32767/gsx_maxx;
gsx_yscale_factor=32767/gsx_maxy;
gios_l_style(1);
gios_clg();
gios_l_color(7);
}
|
862b11bfd7c186827c82573a0f7effd72a5f5450
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/arch/frv/include/uapi/asm/ptrace.h
|
3887e4934683ed5c08715dbce4fcaea3606774c8
|
[
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 1,966
|
h
|
ptrace.h
|
/* ptrace.h: ptrace() relevant definitions
*
* Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* 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 _UAPI_ASM_PTRACE_H
#define _UAPI_ASM_PTRACE_H
#include <asm/registers.h>
#define PT_PSR 0
#define PT_ISR 1
#define PT_CCR 2
#define PT_CCCR 3
#define PT_LR 4
#define PT_LCR 5
#define PT_PC 6
#define PT__STATUS 7 /* exception status */
#define PT_SYSCALLNO 8 /* syscall number or -1 */
#define PT_ORIG_GR8 9 /* saved GR8 for signal handling */
#define PT_GNER0 10
#define PT_GNER1 11
#define PT_IACC0H 12
#define PT_IACC0L 13
#define PT_GR(j) ( 14 + (j)) /* GRj for 0<=j<=63 */
#define PT_FR(j) ( 78 + (j)) /* FRj for 0<=j<=63 */
#define PT_FNER(j) (142 + (j)) /* FNERj for 0<=j<=1 */
#define PT_MSR(j) (144 + (j)) /* MSRj for 0<=j<=2 */
#define PT_ACC(j) (146 + (j)) /* ACCj for 0<=j<=7 */
#define PT_ACCG(jklm) (154 + (jklm)) /* ACCGjklm for 0<=jklm<=1 (reads four regs per slot) */
#define PT_FSR(j) (156 + (j)) /* FSRj for 0<=j<=0 */
#define PT__GPEND 78
#define PT__END 157
#define PT_TBR PT_GR(0)
#define PT_SP PT_GR(1)
#define PT_FP PT_GR(2)
#define PT_PREV_FRAME PT_GR(28) /* previous exception frame pointer (old gr28 value) */
#define PT_CURR_TASK PT_GR(29) /* current task */
/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
#define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13
#define PTRACE_GETFPREGS 14
#define PTRACE_SETFPREGS 15
#define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */
#define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */
#define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */
#endif /* _UAPI_ASM_PTRACE_H */
|
ed816fa400d8f7eda15aee1b2fd8b0c12e26db97
|
83e7dc1281874779c46dfadcc15b2bb66d8e599c
|
/src/draw/sw/lv_draw_sw_transform.c
|
494559721fdf48b1e8e6a52608b3ceaa75f97c0f
|
[
"MIT"
] |
permissive
|
lvgl/lvgl
|
7d51d6774d6ac71df7101fc7ded56fea4b70be01
|
5c984b4a5364b6455966eb3a860153806c51626f
|
refs/heads/master
| 2023-08-30T22:39:20.283922
| 2023-08-30T19:55:29
| 2023-08-30T19:55:29
| 60,667,730
| 9,296
| 2,218
|
MIT
| 2023-09-14T17:59:34
| 2016-06-08T04:14:34
|
C
|
UTF-8
|
C
| false
| false
| 21,051
|
c
|
lv_draw_sw_transform.c
|
/**
* @file lv_draw_sw_tranform.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_sw.h"
#if LV_USE_DRAW_SW
#include "../../misc/lv_assert.h"
#include "../../misc/lv_area.h"
#include "../../core/lv_refr.h"
#include "../../misc/lv_color.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct {
int32_t x_in;
int32_t y_in;
int32_t x_out;
int32_t y_out;
int32_t sinma;
int32_t cosma;
int32_t zoom;
int32_t angle;
int32_t pivot_x_256;
int32_t pivot_y_256;
lv_point_t pivot;
} point_transform_dsc_t;
/**********************
* STATIC PROTOTYPES
**********************/
/**
* Transform a point with 1/256 precision (the output coordinates are upscaled by 256)
* @param t pointer to n initialized `point_transform_dsc_t` structure
* @param xin X coordinate to rotate
* @param yin Y coordinate to rotate
* @param xout upscaled, transformed X
* @param yout upscaled, transformed Y
*/
static void transform_point_upscaled(point_transform_dsc_t * t, int32_t xin, int32_t yin, int32_t * xout,
int32_t * yout);
static void tranform_rgb888(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step,
int32_t x_end, uint8_t * dest_buf, bool aa, uint32_t px_size);
static void tranform_argb8888(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step,
int32_t x_end, uint8_t * dest_buf, bool aa);
static void transform_rgb565a8(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step,
int32_t x_end, uint16_t * cbuf, uint8_t * abuf, bool src_has_a8, bool aa);
static void transform_a8(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step,
int32_t x_end, uint8_t * abuf, bool aa);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_sw_transform(lv_draw_unit_t * draw_unit, const lv_area_t * dest_area, const void * src_buf,
lv_coord_t src_w, lv_coord_t src_h,
const lv_draw_img_dsc_t * draw_dsc, const lv_draw_img_sup_t * sup, lv_color_format_t src_cf, void * dest_buf)
{
LV_UNUSED(draw_unit);
LV_UNUSED(sup);
point_transform_dsc_t tr_dsc;
tr_dsc.angle = -draw_dsc->angle;
tr_dsc.zoom = (256 * 256) / draw_dsc->zoom;
tr_dsc.pivot = draw_dsc->pivot;
int32_t angle_low = tr_dsc.angle / 10;
int32_t angle_high = angle_low + 1;
int32_t angle_rem = tr_dsc.angle - (angle_low * 10);
int32_t s1 = lv_trigo_sin(angle_low);
int32_t s2 = lv_trigo_sin(angle_high);
int32_t c1 = lv_trigo_sin(angle_low + 90);
int32_t c2 = lv_trigo_sin(angle_high + 90);
tr_dsc.sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10;
tr_dsc.cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10;
tr_dsc.sinma = tr_dsc.sinma >> (LV_TRIGO_SHIFT - 10);
tr_dsc.cosma = tr_dsc.cosma >> (LV_TRIGO_SHIFT - 10);
tr_dsc.pivot_x_256 = tr_dsc.pivot.x * 256;
tr_dsc.pivot_y_256 = tr_dsc.pivot.y * 256;
lv_coord_t dest_w = lv_area_get_width(dest_area);
lv_coord_t dest_h = lv_area_get_height(dest_area);
lv_coord_t src_stride = lv_draw_buf_width_to_stride(src_w, src_cf) / lv_color_format_get_size(src_cf);
lv_coord_t dest_stride_a8 = lv_draw_buf_width_to_stride(dest_w, LV_COLOR_FORMAT_A8);
lv_coord_t dest_stride;
if(src_cf == LV_COLOR_FORMAT_RGB888) dest_stride = lv_draw_buf_width_to_stride(dest_w, LV_COLOR_FORMAT_ARGB8888);
else if(src_cf == LV_COLOR_FORMAT_RGB565A8) dest_stride = lv_draw_buf_width_to_stride(dest_w, LV_COLOR_FORMAT_RGB565);
else dest_stride = lv_draw_buf_width_to_stride(dest_w, src_cf);
uint8_t * alpha_buf;
if(src_cf == LV_COLOR_FORMAT_RGB565 || src_cf == LV_COLOR_FORMAT_RGB565A8) {
alpha_buf = dest_buf;
alpha_buf += dest_stride * dest_h;
}
else {
alpha_buf = NULL;
}
bool aa = draw_dsc->antialias;
lv_coord_t y;
for(y = 0; y < dest_h; y++) {
int32_t xs1_ups, ys1_ups, xs2_ups, ys2_ups;
transform_point_upscaled(&tr_dsc, dest_area->x1, dest_area->y1 + y, &xs1_ups, &ys1_ups);
transform_point_upscaled(&tr_dsc, dest_area->x2, dest_area->y1 + y, &xs2_ups, &ys2_ups);
int32_t xs_diff = xs2_ups - xs1_ups;
int32_t ys_diff = ys2_ups - ys1_ups;
int32_t xs_step_256 = 0;
int32_t ys_step_256 = 0;
if(dest_w > 1) {
xs_step_256 = (256 * xs_diff) / (dest_w - 1);
ys_step_256 = (256 * ys_diff) / (dest_w - 1);
}
int32_t xs_ups = xs1_ups + 0x80;
int32_t ys_ups = ys1_ups + 0x80;
switch(src_cf) {
case LV_COLOR_FORMAT_XRGB8888:
tranform_rgb888(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, aa, 4);
break;
case LV_COLOR_FORMAT_RGB888:
tranform_rgb888(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, aa, 3);
break;
case LV_COLOR_FORMAT_A8:
transform_a8(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, aa);
break;
case LV_COLOR_FORMAT_ARGB8888:
tranform_argb8888(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, aa);
break;
case LV_COLOR_FORMAT_RGB565:
transform_rgb565a8(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf,
alpha_buf, false, aa);
break;
case LV_COLOR_FORMAT_RGB565A8:
transform_rgb565a8(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w,
(uint16_t *)dest_buf,
alpha_buf, true, aa);
break;
default:
break;
}
dest_buf = (uint8_t *)dest_buf + dest_stride;
if(alpha_buf) alpha_buf += dest_stride_a8;
}
}
/**********************
* STATIC FUNCTIONS
**********************/
static void tranform_rgb888(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step,
int32_t x_end, uint8_t * dest_buf, bool aa, uint32_t px_size)
{
int32_t xs_ups_start = xs_ups;
int32_t ys_ups_start = ys_ups;
lv_color32_t * dest_c32 = (lv_color32_t *) dest_buf;
lv_coord_t x;
for(x = 0; x < x_end; x++) {
xs_ups = xs_ups_start + ((xs_step * x) >> 8);
ys_ups = ys_ups_start + ((ys_step * x) >> 8);
int32_t xs_int = xs_ups >> 8;
int32_t ys_int = ys_ups >> 8;
/*Fully out of the image*/
if(xs_int < 0 || xs_int >= src_w || ys_int < 0 || ys_int >= src_h) {
dest_c32[x].alpha = 0x00;
continue;
}
/*Get the direction the hor and ver neighbor
*`fract` will be in range of 0x00..0xFF and `next` (+/-1) indicates the direction*/
int32_t xs_fract = xs_ups & 0xFF;
int32_t ys_fract = ys_ups & 0xFF;
int32_t x_next;
int32_t y_next;
if(xs_fract < 0x80) {
x_next = -1;
xs_fract = 0x7F - xs_fract;
}
else {
x_next = 1;
xs_fract = xs_fract - 0x80;
}
if(ys_fract < 0x80) {
y_next = -1;
ys_fract = 0x7F - ys_fract;
}
else {
y_next = 1;
ys_fract = ys_fract - 0x80;
}
const uint8_t * src_u8 = &src[ys_int * src_stride * px_size + xs_int * px_size];
dest_c32[x].red = src_u8[2];
dest_c32[x].green = src_u8[1];
dest_c32[x].blue = src_u8[0];
dest_c32[x].alpha = 0xff;
if(aa &&
xs_int + x_next >= 0 &&
xs_int + x_next <= src_w - 1 &&
ys_int + y_next >= 0 &&
ys_int + y_next <= src_h - 1) {
const uint8_t * px_hor_u8 = src_u8 + (int32_t)(x_next * px_size);
lv_color32_t px_hor;
px_hor.red = px_hor_u8[2];
px_hor.green = px_hor_u8[1];
px_hor.blue = px_hor_u8[0];
px_hor.alpha = 0xff;
const uint8_t * px_ver_u8 = src_u8 + (int32_t)(y_next * src_stride * px_size);
lv_color32_t px_ver;
px_ver.red = px_ver_u8[2];
px_ver.green = px_ver_u8[1];
px_ver.blue = px_ver_u8[0];
px_ver.alpha = 0xff;
if(!lv_color32_eq(dest_c32[x], px_ver)) {
px_ver.alpha = ys_fract;
dest_c32[x] = lv_color_mix32(px_ver, dest_c32[x]);
}
if(!lv_color32_eq(dest_c32[x], px_hor)) {
px_hor.alpha = xs_fract;
dest_c32[x] = lv_color_mix32(px_hor, dest_c32[x]);
}
}
/*Partially out of the image*/
else {
lv_opa_t a = 0xff;
if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) {
dest_c32[x].alpha = (a * (0xFF - xs_fract)) >> 8;
}
else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) {
dest_c32[x].alpha = (a * (0xFF - ys_fract)) >> 8;
}
else {
dest_c32[x].alpha = 0x00;
}
}
}
}
#include "../../stdlib/lv_string.h"
static void tranform_argb8888(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step,
int32_t x_end, uint8_t * dest_buf, bool aa)
{
// lv_memzero(dest_buf, x_end * 4);
int32_t xs_ups_start = xs_ups;
int32_t ys_ups_start = ys_ups;
lv_color32_t * dest_c32 = (lv_color32_t *) dest_buf;
lv_coord_t x;
for(x = 0; x < x_end; x++) {
xs_ups = xs_ups_start + ((xs_step * x) >> 8);
ys_ups = ys_ups_start + ((ys_step * x) >> 8);
int32_t xs_int = xs_ups >> 8;
int32_t ys_int = ys_ups >> 8;
/*Fully out of the image*/
if(xs_int < 0 || xs_int >= src_w || ys_int < 0 || ys_int >= src_h) {
((uint32_t *)dest_buf)[x] = 0x00000000;
continue;
}
/*Get the direction the hor and ver neighbor
*`fract` will be in range of 0x00..0xFF and `next` (+/-1) indicates the direction*/
int32_t xs_fract = xs_ups & 0xFF;
int32_t ys_fract = ys_ups & 0xFF;
int32_t x_next;
int32_t y_next;
if(xs_fract < 0x80) {
x_next = -1;
xs_fract = 0x7F - xs_fract;
}
else {
x_next = 1;
xs_fract = xs_fract - 0x80;
}
if(ys_fract < 0x80) {
y_next = -1;
ys_fract = 0x7F - ys_fract;
}
else {
y_next = 1;
ys_fract = ys_fract - 0x80;
}
const lv_color32_t * src_c32 = (const lv_color32_t *)src;
src_c32 += (ys_int * src_stride) + xs_int;
dest_c32[x] = src_c32[0];
if(aa &&
xs_int + x_next >= 0 &&
xs_int + x_next <= src_w - 1 &&
ys_int + y_next >= 0 &&
ys_int + y_next <= src_h - 1) {
lv_color32_t px_hor = src_c32[x_next];
lv_color32_t px_ver = src_c32[y_next * src_stride];
if(px_ver.alpha == 0) {
dest_c32[x].alpha = (dest_c32[x].alpha * (0xFF - ys_fract)) >> 8;
}
else if(!lv_color32_eq(dest_c32[x], px_ver)) {
dest_c32[x].alpha = ((px_ver.alpha * ys_fract) + (dest_c32[x].alpha * (0xFF - ys_fract))) >> 8;
px_ver.alpha = ys_fract;
dest_c32[x] = lv_color_mix32(px_ver, dest_c32[x]);
}
if(px_hor.alpha == 0) {
dest_c32[x].alpha = (dest_c32[x].alpha * (0xFF - xs_fract)) >> 8;
}
else if(!lv_color32_eq(dest_c32[x], px_hor)) {
dest_c32[x].alpha = ((px_hor.alpha * xs_fract) + (dest_c32[x].alpha * (0xFF - xs_fract))) >> 8;
px_hor.alpha = xs_fract;
dest_c32[x] = lv_color_mix32(px_hor, dest_c32[x]);
}
}
/*Partially out of the image*/
else {
if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) {
dest_c32[x].alpha = (dest_c32[x].alpha * (0x7F - xs_fract)) >> 7;
}
else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) {
dest_c32[x].alpha = (dest_c32[x].alpha * (0x7F - ys_fract)) >> 7;
}
else {
dest_c32[x].alpha = 0x00;
}
}
}
}
static void transform_rgb565a8(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step,
int32_t x_end, uint16_t * cbuf, uint8_t * abuf, bool src_has_a8, bool aa)
{
int32_t xs_ups_start = xs_ups;
int32_t ys_ups_start = ys_ups;
const uint16_t * src_rgb = (const uint16_t *)src;
const lv_opa_t * src_alpha = src + src_stride * src_h * 2;
lv_coord_t x;
for(x = 0; x < x_end; x++) {
xs_ups = xs_ups_start + ((xs_step * x) >> 8);
ys_ups = ys_ups_start + ((ys_step * x) >> 8);
int32_t xs_int = xs_ups >> 8;
int32_t ys_int = ys_ups >> 8;
/*Fully out of the image*/
if(xs_int < 0 || xs_int >= src_w || ys_int < 0 || ys_int >= src_h) {
abuf[x] = 0x00;
continue;
}
/*Get the direction the hor and ver neighbor
*`fract` will be in range of 0x00..0xFF and `next` (+/-1) indicates the direction*/
int32_t xs_fract = xs_ups & 0xFF;
int32_t ys_fract = ys_ups & 0xFF;
int32_t x_next;
int32_t y_next;
if(xs_fract < 0x80) {
x_next = -1;
xs_fract = (0x7F - xs_fract) * 2;
}
else {
x_next = 1;
xs_fract = (xs_fract - 0x80) * 2;
}
if(ys_fract < 0x80) {
y_next = -1;
ys_fract = (0x7F - ys_fract) * 2;
}
else {
y_next = 1;
ys_fract = (ys_fract - 0x80) * 2;
}
const uint16_t * src_tmp_u16 = (const uint16_t *)src_rgb;
src_tmp_u16 += (ys_int * src_stride) + xs_int;
cbuf[x] = src_tmp_u16[0];
if(aa &&
xs_int + x_next >= 0 &&
xs_int + x_next <= src_w - 1 &&
ys_int + y_next >= 0 &&
ys_int + y_next <= src_h - 1) {
uint16_t px_hor = src_tmp_u16[x_next];
uint16_t px_ver = src_tmp_u16[y_next * src_stride];
if(src_has_a8) {
const lv_opa_t * src_alpha_tmp = src_alpha;
src_alpha_tmp += (ys_int * src_stride) + xs_int;
abuf[x] = src_alpha_tmp[0];
lv_opa_t a_hor = src_alpha_tmp[x_next];
lv_opa_t a_ver = src_alpha_tmp[y_next * src_stride];
if(a_ver != abuf[x]) a_ver = ((a_ver * ys_fract) + (abuf[x] * (0x100 - ys_fract))) >> 8;
if(a_hor != abuf[x]) a_hor = ((a_hor * xs_fract) + (abuf[x] * (0x100 - xs_fract))) >> 8;
abuf[x] = (a_ver + a_hor) >> 1;
if(abuf[x] == 0x00) continue;
}
else {
abuf[x] = 0xff;
}
if(cbuf[x] != px_ver || cbuf[x] != px_hor) {
uint16_t v = lv_color_16_16_mix(px_ver, cbuf[x], ys_fract);
uint16_t h = lv_color_16_16_mix(px_hor, cbuf[x], xs_fract);
cbuf[x] = lv_color_16_16_mix(h, v, LV_OPA_50);
}
}
/*Partially out of the image*/
else {
lv_opa_t a;
if(src_has_a8) {
const lv_opa_t * src_alpha_tmp = src_alpha;
src_alpha_tmp += (ys_int * src_stride) + xs_int;
a = src_alpha_tmp[0];
}
else {
a = 0xff;
}
if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) {
abuf[x] = (a * (0xFF - xs_fract)) >> 8;
}
else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) {
abuf[x] = (a * (0xFF - ys_fract)) >> 8;
}
else {
abuf[x] = 0x00;
}
}
}
}
static void transform_a8(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step,
int32_t x_end, uint8_t * abuf, bool aa)
{
int32_t xs_ups_start = xs_ups;
int32_t ys_ups_start = ys_ups;
lv_coord_t x;
for(x = 0; x < x_end; x++) {
xs_ups = xs_ups_start + ((xs_step * x) >> 8);
ys_ups = ys_ups_start + ((ys_step * x) >> 8);
int32_t xs_int = xs_ups >> 8;
int32_t ys_int = ys_ups >> 8;
/*Fully out of the image*/
if(xs_int < 0 || xs_int >= src_w || ys_int < 0 || ys_int >= src_h) {
abuf[x] = 0x00;
continue;
}
/*Get the direction the hor and ver neighbor
*`fract` will be in range of 0x00..0xFF and `next` (+/-1) indicates the direction*/
int32_t xs_fract = xs_ups & 0xFF;
int32_t ys_fract = ys_ups & 0xFF;
int32_t x_next;
int32_t y_next;
if(xs_fract < 0x80) {
x_next = -1;
xs_fract = (0x7F - xs_fract) * 2;
}
else {
x_next = 1;
xs_fract = (xs_fract - 0x80) * 2;
}
if(ys_fract < 0x80) {
y_next = -1;
ys_fract = (0x7F - ys_fract) * 2;
}
else {
y_next = 1;
ys_fract = (ys_fract - 0x80) * 2;
}
const uint8_t * src_tmp = src;
src_tmp += ys_int * src_stride + xs_int;
abuf[x] = src_tmp[0];
if(aa &&
xs_int + x_next >= 0 &&
xs_int + x_next <= src_w - 1 &&
ys_int + y_next >= 0 &&
ys_int + y_next <= src_h - 1) {
lv_opa_t a_ver = src_tmp[x_next];
lv_opa_t a_hor = src_tmp[y_next * src_stride];
if(a_ver != abuf[x]) a_ver = ((a_ver * ys_fract) + (abuf[x] * (0x100 - ys_fract))) >> 8;
if(a_hor != abuf[x]) a_hor = ((a_hor * xs_fract) + (abuf[x] * (0x100 - xs_fract))) >> 8;
abuf[x] = (a_ver + a_hor) >> 1;
}
else {
/*Partially out of the image*/
if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) {
abuf[x] = (src_tmp[0] * (0xFF - xs_fract)) >> 8;
}
else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) {
abuf[x] = (src_tmp[0] * (0xFF - ys_fract)) >> 8;
}
else {
abuf[x] = 0x00;
}
}
}
}
static void transform_point_upscaled(point_transform_dsc_t * t, int32_t xin, int32_t yin, int32_t * xout,
int32_t * yout)
{
if(t->angle == 0 && t->zoom == LV_ZOOM_NONE) {
*xout = xin * 256;
*yout = yin * 256;
return;
}
xin -= t->pivot.x;
yin -= t->pivot.y;
if(t->angle == 0) {
*xout = ((int32_t)(xin * t->zoom)) + (t->pivot_x_256);
*yout = ((int32_t)(yin * t->zoom)) + (t->pivot_y_256);
}
else if(t->zoom == LV_ZOOM_NONE) {
*xout = ((t->cosma * xin - t->sinma * yin) >> 2) + (t->pivot_x_256);
*yout = ((t->sinma * xin + t->cosma * yin) >> 2) + (t->pivot_y_256);
}
else {
*xout = (((t->cosma * xin - t->sinma * yin) * t->zoom) >> 10) + (t->pivot_x_256);
*yout = (((t->sinma * xin + t->cosma * yin) * t->zoom) >> 10) + (t->pivot_y_256);
}
}
#endif /*LV_USE_DRAW_SW*/
|
716bc82f982d1ba96e4f690a83f3a77cf22e61d2
|
376e1818d427b5e4d32fa6dd6c7b71e9fd88afdb
|
/net/dante/patches/patch-dlib_interposition.c
|
6b6f3d935b85c98fc7d7695d26feb741b7c7a549
|
[] |
no_license
|
NetBSD/pkgsrc
|
a0732c023519650ef821ab89c23ab6ab59e25bdb
|
d042034ec4896cc5b47ed6f2e5b8802d9bc5c556
|
refs/heads/trunk
| 2023-09-01T07:40:12.138283
| 2023-09-01T05:25:19
| 2023-09-01T05:25:19
| 88,439,572
| 321
| 138
| null | 2023-07-12T22:34:14
| 2017-04-16T20:04:15
| null |
UTF-8
|
C
| false
| false
| 843
|
c
|
patch-dlib_interposition.c
|
$NetBSD: patch-dlib_interposition.c,v 1.2 2021/06/01 07:42:08 adam Exp $
o Do not use ssp(3) when compiling interposition.c:
interposition.c:1728:1: error: redefinition of 'read'
read(d, buf, nbytes)
^
In file included from /usr/include/ssp/stdio.h:34:0,
from /usr/include/stdio.h:597,
from ../include/osdep.h:158,
from ../include/common.h:56,
from interposition.c:47:
/usr/include/ssp/unistd.h:39:1: note: previous definition of 'read' was here
__ssp_redirect0(ssize_t, read, (int __fd, void *__buf, size_t __len), \
^
--- dlib/interposition.c.orig 2020-11-11 16:11:56.000000000 +0000
+++ dlib/interposition.c
@@ -1,3 +1,4 @@
+#undef _FORTIFY_SOURCE
/*
* Copyright (c) 1997, 1998, 1999, 2000, 2001, 2004, 2008, 2009, 2010, 2011,
* 2012, 2013, 2016, 2017, 2020
|
a30493a29049e17f75a222d80f25e8c93691a935
|
e9911598c43e8526da22b2773a73d9b5966f602a
|
/imap/squat_internal.h
|
05a2a9a74fa2e2fef620779ff445fc5905cbf5eb
|
[
"LicenseRef-scancode-warranty-disclaimer",
"BSD-2-Clause"
] |
permissive
|
cyrusimap/cyrus-imapd
|
07236dfd887ed92c147938cf1ed2591449d7e8fd
|
315441d067ba85814768f840f20bc3bb7f20ea6b
|
refs/heads/master
| 2023-09-05T09:57:10.683822
| 2023-09-05T06:09:43
| 2023-09-05T06:09:43
| 59,071,965
| 508
| 164
|
NOASSERTION
| 2023-09-13T04:34:31
| 2016-05-18T01:33:49
|
C
|
UTF-8
|
C
| false
| false
| 8,579
|
h
|
squat_internal.h
|
/*
* Copyright (c) 1994-2008 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any legal
* details, please contact
* Carnegie Mellon University
* Center for Technology Transfer and Enterprise Creation
* 4615 Forbes Avenue
* Suite 302
* Pittsburgh, PA 15213
* (412) 268-7393, fax: (412) 268-7395
* innovation@andrew.cmu.edu
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Computing Services
* at Carnegie Mellon University (http://www.cmu.edu/computing/)."
*
* CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY 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.
*/
/*
SQUAT internal utility functions and definitions, used only by other
SQUAT components.
Robert O'Callahan
IMPLEMENTATION NOTES:
In the following, I assume that SQUAT_WORD_SIZE has its default value of 4.
For each 'word' (string of 4 consecutive bytes) occurring in the
source documents, the SQUAT index records which documents the word
occurs in. To search for an arbitrary string of K >= 4 bytes, SQUAT
computes the set of documents which contain all K-3 words that the
substring contains.
For example, if we search for "a kitty", SQUAT will return every
document which contains each of the substrings "a ki", " kit",
"kitt", and "itty". Obviously every document containing "a kitty"
also contains those substrings, but other documents may be returned
which do not contain "a kitty". (For example, the document "a killer
kitty" would also be returned.) However, experiments on an email
corpus seem to show that such false matches are very uncommon.
The index contains three main data structures. There is a doc-list
structure which simply records the name and size of each source
document. Each entry in this structure has variable length; it is
designed to be traversed sequentially by squat_search_list_docs.
There is a doc-ID-list structure which is an array, indexed by the
doc-ID, of offsets to the doc-list element for that doc-ID. This is
designed to allow for efficient recovery of the name of a document
given its ID.
The rest of the file is a trie, describing the documents containing
each words. Each trie is exactly 3 levels deep, indexed by the first
three characters of each word. Each leaf of a trie is a list of
lists of documents, one list of documents per last character of a
word. The 256-way branch tables within the tries, and the document
lists, are stored using mildly clever encodings to reduce space
consumption.
The file contains SQUAT_SAFETY_ZONE (currently 16) zero bytes at the
end. They are there to stop runaway decoding loops from segfaulting;
these loops can assume the bytes are there, scan away with
guaranteed termination, and then detect errors after the fact. We
check that these safety bytes are there and zero when we open an
index for reading!
Any words containing any 'invalid characters' as specified by the
index creator are simply dropped from the index. The invalid
characters are recorded so that clients can get a meaningful error
if they try to perform a search using those characters (otherwise
they'd just get no documents returned).
*/
#ifndef __SQUAT_INTERNAL_H
#define __SQUAT_INTERNAL_H
#include "squat.h"
#define SQUAT_SAFETY_ZONE 16
/* The format of a SQUAT index file. This record is stored at the
beginning of the file. */
typedef struct {
char header_text[8]; /* "SQUAT 1\n" */
char doc_list_offset[8]; /* offset to a doc-list structure (see below) */
char doc_ID_list_offset[8];/* offset to a doc-ID-list structure (see below) */
char word_list_offset[8]; /* offset to a word-list structure (see below) */
char valid_char_bits[32]; /* a bitmap recording which characters
appear in the index. The client
promises that query strings will not
contain characters which don't have
their bits set in the bitmap. */
} SquatDiskHeader;
/* Index file format
"I" means an unsigned integer decoded as N bytes as follows:
The low 7 bits of each byte encode the integer (most significant byte
first). The high 8th bit of the first N-1 bytes is 1 and the high 8th bit
of the Nth byte is 0.
"N" means a null-terminated UTF8 string.
"8" means an 8-bit byte.
"32" means a 32-bit signed integer in big-endian format.
"64" means a 64-bit signed integer in big-endian format.
K = SQUAT_WORD_SIZE-1
<doc-ID-list> = 32"doc-ID-offset"* 0 0 0 0
<doc-list> = <document-info>* 0
<document-info> = S"name" I"length"
<word-list> = <word-list-trie-1>* <trie-index>
<trie-index> = <present-bits> I<subtrie-backwards-offset>*
<present-bits> = 8"singleton"
| 8"start-byte" 8"count-bytes-minus-one" 8"present-bytes"*
<word-list-trie-1> = <word-list-trie-2>* <trie-index>
...
<word-list-trie-K> = <present-bits> <word-trie-info>*
<word-trie-info> = <index-run>"documents"
<index-run> = I"adjusted-single-index"
| I"adjusted-run-size" <index-run-list>*
<index-run-list> = I"adjusted-single-index-delta"
= I"adjusted-run-length" I"first-index-delta"
The adjusted-single-index is the actual index shifted left one bit with the
bottom bit set to 1.
The adjusted-run-size is the actual run size (in bytes) shifted left one
bit with the bottom bit set to 0.
The adjusted-single-index-delta is the actual index shifted left one bit
with the bottom bit set to 1.
The adjusted-run-length is the length of the run of consecutive indices
shifted left one bit with the bottom bit set to 0.
The last SQUAT_SAFETY_ZONE bytes of the index file must be 0.
This helps protect us against corrupt index files.
*/
void squat_set_last_error(int err);
/* Decode and encode a 32-bit quantity into a 4-byte field in an
architecture-independent (big-endian) format. */
SquatInt32 squat_decode_32(char const* s);
/* We return s + 4. */
char* squat_encode_32(char* s, SquatInt32 v);
/* Decode and encode a 64-bit quantity into an 8-byte field in an
architecture-independent (big-endian) format. */
SquatInt64 squat_decode_64(char const* s);
/* We return s + 8. */
char* squat_encode_64(char* s, SquatInt64 v);
/* Decode and encode a 64-bit quantity into a variable length field in
an architecture-independent format. We use one byte for every 7
significant bits of the value.
For safety when encoding, make sure there are at least 10 bytes of
space available at s.
For safety when decoding, make sure that there is at least one zero
byte following the data at s.
Only non-negative integers can be encoded using these
routines. Negative integers might be returned from decoding if the
data was corrupted. */
/* *s is incremented to point past the decoded value. */
SquatInt64 squat_decode_I(char const** s);
/* num_to_skip encoded values are decoded and discarded. We return a
pointer past the end of the decoded values. */
char const* squat_decode_skip_I(char const* s, int num_to_skip);
/* We return a pointer past the encoded value. */
char* squat_encode_I(char* s, SquatInt64 v);
/* We return the number of bytes required to encode the given value. */
int squat_count_encode_I(SquatInt64 v64);
#endif
|
28f9892674bcd2201db9f422c5b94e476462779f
|
e9b2c1f687bb9f34732d7eb2bc784a75705a371e
|
/common/include/random.h
|
86b25882a1aa56cd994f6de4306e5cfdd342ae2f
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
libguestfs/nbdkit
|
30bf70eb29843805597a6bbe5b56cc024bfedead
|
45b72f5bd8fc1b475fa130d06c86cd877bf595d5
|
refs/heads/master
| 2023-09-02T12:48:33.201066
| 2023-03-10T09:59:15
| 2023-03-10T10:08:50
| 10,839,800
| 209
| 45
|
NOASSERTION
| 2021-01-24T00:25:00
| 2013-06-21T09:43:21
|
C
|
UTF-8
|
C
| false
| false
| 3,513
|
h
|
random.h
|
/* nbdkit
* Copyright Red Hat
*
* 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 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 RED HAT 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 RED HAT 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 NBDKIT_RANDOM_H
#define NBDKIT_RANDOM_H
#include <stdint.h>
/* Generate pseudo-random numbers, quickly, with explicit state.
*
* This is based on the xoshiro/xoroshiro generators by David Blackman
* and Sebastiano Vigna (http://xoshiro.di.unimi.it/). Specifically
* the main PRNG is ‘xoshiro256** 1.0’, and the seed generator is
* ‘splitmix64’.
*
* This does _NOT_ generate cryptographically secure random numbers
* (CSPRNG) and so should not be used when cryptography or security is
* required - use gcrypt if you need those.
*/
/* You can seed ‘struct random_state’ by setting the s[] elements
* directly - but you must NOT set them all to zero. Alternately if
* you have a 64 bit seed, you can call xsrandom to initialize the
* state.
*/
struct random_state {
uint64_t s[4];
};
static inline uint64_t
snext (uint64_t *seed)
{
uint64_t z = (*seed += 0x9e3779b97f4a7c15);
z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9;
z = (z ^ (z >> 27)) * 0x94d049bb133111eb;
return z ^ (z >> 31);
}
/* Seed the random state from a 64 bit seed. */
static inline void __attribute__ ((__nonnull__ (2)))
xsrandom (uint64_t seed, struct random_state *state)
{
state->s[0] = snext (&seed);
state->s[1] = snext (&seed);
state->s[2] = snext (&seed);
state->s[3] = snext (&seed);
}
static inline uint64_t
rotl (const uint64_t x, int k)
{
/* RWMJ: I checked and GCC 10 emits either ‘rol’ or ‘ror’ correctly
* for this code.
*/
return (x << k) | (x >> (64 - k));
}
/* Returns 64 random bits. Updates the state. */
static inline uint64_t __attribute__ ((__nonnull__ (1)))
xrandom (struct random_state *state)
{
const uint64_t result_starstar = rotl (state->s[1] * 5, 7) * 9;
const uint64_t t = state->s[1] << 17;
state->s[2] ^= state->s[0];
state->s[3] ^= state->s[1];
state->s[1] ^= state->s[2];
state->s[0] ^= state->s[3];
state->s[2] ^= t;
state->s[3] = rotl (state->s[3], 45);
return result_starstar;
}
#endif /* NBDKIT_RANDOM_H */
|
fa1da07e1db530510e16b91936c4e1d55aa526f6
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/net/usrsock/usrsock_event.c
|
f365e16f45a70a7f3f0ae21f47922dc16f0a0b92
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 3,450
|
c
|
usrsock_event.c
|
/****************************************************************************
* net/usrsock/usrsock_event.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && defined(CONFIG_NET_USRSOCK)
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <debug.h>
#include <arch/irq.h>
#include <sys/socket.h>
#include <nuttx/net/net.h>
#include <nuttx/net/usrsock.h>
#include "devif/devif.h"
#include "usrsock/usrsock.h"
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: usrsock_event
*
* Description:
* Handler for received connection events
*
****************************************************************************/
int usrsock_event(FAR struct usrsock_conn_s *conn)
{
uint16_t events = conn->resp.events;
ninfo("events: %04X\n", events);
if (!events)
{
return OK;
}
net_lock();
/* Generic state updates. */
if (conn->state == USRSOCK_CONN_STATE_CONNECTING)
{
if ((events & USRSOCK_EVENT_REQ_COMPLETE) ||
(events & USRSOCK_EVENT_SENDTO_READY))
{
conn->state = USRSOCK_CONN_STATE_READY;
events |= USRSOCK_EVENT_CONNECT_READY;
if (conn->resp.result == 0)
{
conn->connected = true;
}
}
}
if (events & USRSOCK_EVENT_ABORT)
{
conn->state = USRSOCK_CONN_STATE_ABORTED;
}
if ((conn->state == USRSOCK_CONN_STATE_READY ||
conn->state == USRSOCK_CONN_STATE_CONNECTING) &&
!(conn->flags & USRSOCK_EVENT_REMOTE_CLOSED))
{
if (events & USRSOCK_EVENT_SENDTO_READY)
{
conn->flags |= USRSOCK_EVENT_SENDTO_READY;
}
if (events & USRSOCK_EVENT_RECVFROM_AVAIL)
{
conn->flags |= USRSOCK_EVENT_RECVFROM_AVAIL;
}
}
if (events & USRSOCK_EVENT_REMOTE_CLOSED)
{
/* After reception of remote close event, clear input flags. */
conn->flags &= ~USRSOCK_EVENT_SENDTO_READY;
conn->flags |= USRSOCK_EVENT_REMOTE_CLOSED;
}
/* Send events to callbacks */
devif_conn_event(NULL, events, conn->sconn.list);
net_unlock();
return OK;
}
#endif /* CONFIG_NET && CONFIG_NET_USRSOCK */
|
8d52349d5e7eb70a2f7103dc793b5c01fb44569a
|
f3eed0234b4d0ad2bbb2abd700cf1e2c7a0e8a1d
|
/AKWF-c/AKWF_fmsynth/AKWF_fmsynth_0094.h
|
15077f287c8c407331dc8e25d6dd1ed3f2395371
|
[
"CC0-1.0"
] |
permissive
|
KristofferKarlAxelEkstrand/AKWF-FREE
|
b2defa1a2d389d309be6dd2e9f968923daf80d1b
|
cf8171df36e9fec25416b5f568b72a6e2cb69194
|
refs/heads/master
| 2023-07-23T18:22:36.939705
| 2023-07-10T17:14:40
| 2023-07-10T17:14:40
| 145,817,187
| 359
| 59
|
CC0-1.0
| 2023-07-10T17:14:41
| 2018-08-23T07:26:56
| null |
UTF-8
|
C
| false
| false
| 4,688
|
h
|
AKWF_fmsynth_0094.h
|
/* Adventure Kid Waveforms (AKWF) converted for use with Teensy Audio Library
*
* Adventure Kid Waveforms(AKWF) Open waveforms library
* https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/
*
* This code is in the public domain, CC0 1.0 Universal (CC0 1.0)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* Converted by Brad Roy, https://github.com/prosper00
*/
/* AKWF_fmsynth_0094 256 samples
+-----------------------------------------------------------------------------------------------------------------+
| *** ********** **** ** * ** ** |
| ** *** ** ** * * |
| ** *** ** * * * |
| ** *** * * * * |
| ** ** ** * * * |
|** ** ** * ** * |
|* *** ** * * * |
| *** ** * ** * |
| **** *** * * * *|
| ***** ****** * ** * **|
| **** * * * * |
| * ** * * |
| * ** * ** |
| * * ** ** |
| * * * ** |
+-----------------------------------------------------------------------------------------------------------------+
*/
const uint16_t AKWF_fmsynth_0094 [] = {
33063, 34785, 37313, 39675, 41917, 44104, 46191, 48192, 50104, 51908, 53611, 55196, 56670, 58031, 59278, 60405,
61410, 62299, 63074, 63733, 64284, 64725, 65063, 65308, 65462, 65531, 65523, 65448, 65312, 65124, 64892, 64625,
64331, 64021, 63698, 63374, 63054, 62747, 62456, 62193, 61958, 61756, 61590, 61463, 61377, 61332, 61328, 61369,
61448, 61566, 61719, 61906, 62124, 62362, 62622, 62897, 63184, 63475, 63766, 64050, 64325, 64583, 64820, 65029,
65208, 65351, 65456, 65521, 65535, 65505, 65422, 65288, 65097, 64855, 64557, 64202, 63793, 63328, 62811, 62239,
61617, 60948, 60232, 59466, 58663, 57820, 56942, 56032, 55086, 54114, 53118, 52099, 51066, 50017, 48951, 47878,
46798, 45718, 44642, 43563, 42485, 41420, 40361, 39324, 38297, 37284, 36293, 35321, 34375, 33457, 32565, 31700,
30867, 30062, 29293, 28559, 27859, 27198, 26575, 25990, 25441, 24937, 24474, 24052, 23674, 23338, 23048, 22802,
22598, 22440, 22333, 22274, 22259, 22291, 22374, 22508, 22692, 22928, 23213, 23555, 23949, 24394, 24897, 25456,
26071, 26744, 27473, 28257, 29106, 30013, 30976, 31997, 33071, 34205, 35399, 36647, 37948, 39298, 40691, 42139,
43626, 45150, 46709, 48282, 49878, 51488, 53096, 54693, 56262, 57781, 59253, 60635, 61917, 63052, 64030, 64796,
65317, 65530, 65393, 64831, 63773, 62132, 59815, 56705, 52722, 47708, 41359, 33892, 25943, 19009, 13508, 8994,
5523, 2955, 1243, 282, 1, 321, 1178, 2504, 4240, 6315, 8702, 11343, 14194, 17227, 20381, 23648,
27007, 30410, 33848, 37279, 40676, 44032, 47309, 50461, 53470, 56254, 58802, 61047, 62922, 64349, 65250, 65533,
65102, 63832, 61607, 58311, 53797, 47905, 40210, 31403, 22815, 15811, 10522, 6439, 3523, 1546, 435, 4,
192, 869, 1982, 3430, 5162, 7125, 9274, 11562, 13961, 16428, 18942, 21504, 24062, 26609, 29242, 31717,
};
|
da533439d951caf899afd447d6f7b820c8135f40
|
7744859512f027ef0da8b1bde0f8518e631b98eb
|
/soh/assets/objects/object_bird/object_bird.h
|
6066d3cb5ba16086774ea42cf0d8a2c0376ca3d3
|
[] |
no_license
|
HarbourMasters/Shipwright
|
7f70b9470e4f9a117f3fe2d6e4deb776b8742182
|
0e7c6585239c0d7ea2c039b8b8cb7eaedf8928a9
|
refs/heads/develop
| 2023-08-31T20:50:56.253521
| 2023-08-30T17:34:06
| 2023-08-30T17:34:06
| 472,575,717
| 2,104
| 459
| null | 2023-09-14T20:29:01
| 2022-03-22T01:42:52
|
C
|
UTF-8
|
C
| false
| false
| 2,116
|
h
|
object_bird.h
|
#pragma once
#include "align_asset_macro.h"
#define dgBirdFlyAnim "__OTR__objects/object_bird/gBirdFlyAnim"
static const ALIGN_ASSET(2) char gBirdFlyAnim[] = dgBirdFlyAnim;
#define dgBirdLeftWingDL "__OTR__objects/object_bird/gBirdLeftWingDL"
static const ALIGN_ASSET(2) char gBirdLeftWingDL[] = dgBirdLeftWingDL;
#define dgBirdLeftWingWrapper1DL "__OTR__objects/object_bird/gBirdLeftWingWrapper1DL"
static const ALIGN_ASSET(2) char gBirdLeftWingWrapper1DL[] = dgBirdLeftWingWrapper1DL;
#define dgBirdLeftWingWrapper2DL "__OTR__objects/object_bird/gBirdLeftWingWrapper2DL"
static const ALIGN_ASSET(2) char gBirdLeftWingWrapper2DL[] = dgBirdLeftWingWrapper2DL;
#define dgBirdRightWingDL "__OTR__objects/object_bird/gBirdRightWingDL"
static const ALIGN_ASSET(2) char gBirdRightWingDL[] = dgBirdRightWingDL;
#define dgBirdRightWingWrapper1DL "__OTR__objects/object_bird/gBirdRightWingWrapper1DL"
static const ALIGN_ASSET(2) char gBirdRightWingWrapper1DL[] = dgBirdRightWingWrapper1DL;
#define dgBirdRightWingWrapper2DL "__OTR__objects/object_bird/gBirdRightWingWrapper2DL"
static const ALIGN_ASSET(2) char gBirdRightWingWrapper2DL[] = dgBirdRightWingWrapper2DL;
#define dgBirdBodyDL "__OTR__objects/object_bird/gBirdBodyDL"
static const ALIGN_ASSET(2) char gBirdBodyDL[] = dgBirdBodyDL;
#define dgBirdBodyWrapper1DL "__OTR__objects/object_bird/gBirdBodyWrapper1DL"
static const ALIGN_ASSET(2) char gBirdBodyWrapper1DL[] = dgBirdBodyWrapper1DL;
#define dgBirdBodyWrapper2DL "__OTR__objects/object_bird/gBirdBodyWrapper2DL"
static const ALIGN_ASSET(2) char gBirdBodyWrapper2DL[] = dgBirdBodyWrapper2DL;
#define dgBirdFaceTex "__OTR__objects/object_bird/gBirdFaceTex"
static const ALIGN_ASSET(2) char gBirdFaceTex[] = dgBirdFaceTex;
#define dgBirdTailTex "__OTR__objects/object_bird/gBirdTailTex"
static const ALIGN_ASSET(2) char gBirdTailTex[] = dgBirdTailTex;
#define dgBirdWingTex "__OTR__objects/object_bird/gBirdWingTex"
static const ALIGN_ASSET(2) char gBirdWingTex[] = dgBirdWingTex;
#define dgBirdSkel "__OTR__objects/object_bird/gBirdSkel"
static const ALIGN_ASSET(2) char gBirdSkel[] = dgBirdSkel;
|
10c4e7325286882281189d37bb86e67a677c75ad
|
930e24019ec42ad7633eebfa974a05773167f210
|
/limbo/thirdparty/Csdp/example/example.c
|
492c60cd91cc3c22322def092621138bc2d076bb
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"CPL-1.0"
] |
permissive
|
limbo018/Limbo
|
ab3d75ff13d57042acb5b14e3f97c643bbd7f0c9
|
f66d910cc1ce589185bad3da1d26a10710036302
|
refs/heads/master
| 2023-08-21T16:20:39.651170
| 2023-07-21T08:36:24
| 2023-07-21T08:36:24
| 106,957,057
| 116
| 48
|
MIT
| 2023-07-21T08:36:25
| 2017-10-14T19:35:04
|
C++
|
UTF-8
|
C
| false
| false
| 12,583
|
c
|
example.c
|
/*
An example showing how to call the easy_sdp() interface to CSDP. In
this example, we solve the problem
max tr(C*X)
tr(A1*X)=1
tr(A2*X)=2
X >= 0 (X is PSD)
where
C=[2 1
1 2
3 0 1
0 2 0
1 0 3
0
0]
A1=[3 1
1 3
0 0 0
0 0 0
0 0 0
1
0]
A2=[0 0
0 0
3 0 1
0 4 0
1 0 5
0
1]
Notice that all of the matrices have block diagonal structure. The first
block is of size 2x2. The second block is of size 3x3. The third block
is a diagonal block of size 2.
*/
/*
* These standard declarations for the C library are needed.
*/
#include <stdlib.h>
#include <stdio.h>
/*
* Include CSDP declarations so that we'll know the calling interfaces.
*/
#include "declarations.h"
/*
* The main program. Setup data structures with the problem data, write
* the problem out in SDPA sparse format, and then solve the problem.
*/
int main()
{
/*
* The problem and solution data.
*/
struct blockmatrix C;
double *b;
struct constraintmatrix *constraints;
/*
* Storage for the initial and final solutions.
*/
struct blockmatrix X,Z;
double *y;
double pobj,dobj;
/*
* blockptr will be used to point to blocks in constraint matrices.
*/
struct sparseblock *blockptr;
/*
* A return code for the call to easy_sdp().
*/
int ret;
/*
* The first major task is to setup the C matrix and right hand side b.
*/
/*
* First, allocate storage for the C matrix. We have three blocks, but
* because C starts arrays with index 0, we have to allocate space for
* four blocks- we'll waste the 0th block. Notice that we check to
* make sure that the malloc succeeded.
*/
C.nblocks=3;
C.blocks=(struct blockrec *)malloc(4*sizeof(struct blockrec));
if (C.blocks == NULL)
{
printf("Couldn't allocate storage for C!\n");
exit(1);
};
/*
* Setup the first block.
*/
C.blocks[1].blockcategory=MATRIX;
C.blocks[1].blocksize=2;
C.blocks[1].data.mat=(double *)malloc(2*2*sizeof(double));
if (C.blocks[1].data.mat == NULL)
{
printf("Couldn't allocate storage for C!\n");
exit(1);
};
/*
* Put the entries into the first block.
*/
C.blocks[1].data.mat[ijtok(1,1,2)]=2.0;
C.blocks[1].data.mat[ijtok(1,2,2)]=1.0;
C.blocks[1].data.mat[ijtok(2,1,2)]=1.0;
C.blocks[1].data.mat[ijtok(2,2,2)]=2.0;
/*
* Setup the second block.
*/
C.blocks[2].blockcategory=MATRIX;
C.blocks[2].blocksize=3;
C.blocks[2].data.mat=(double *)malloc(3*3*sizeof(double));
if (C.blocks[2].data.mat == NULL)
{
printf("Couldn't allocate storage for C!\n");
exit(1);
};
/*
* Put the entries into the second block.
*/
C.blocks[2].data.mat[ijtok(1,1,3)]=3.0;
C.blocks[2].data.mat[ijtok(1,2,3)]=0.0;
C.blocks[2].data.mat[ijtok(1,3,3)]=1.0;
C.blocks[2].data.mat[ijtok(2,1,3)]=0.0;
C.blocks[2].data.mat[ijtok(2,2,3)]=2.0;
C.blocks[2].data.mat[ijtok(2,3,3)]=0.0;
C.blocks[2].data.mat[ijtok(3,1,3)]=1.0;
C.blocks[2].data.mat[ijtok(3,2,3)]=0.0;
C.blocks[2].data.mat[ijtok(3,3,3)]=3.0;
/*
* Setup the third block. Note that we have to allocate space for 3
* entries because C starts array indexing with 0 rather than 1.
*/
C.blocks[3].blockcategory=DIAG;
C.blocks[3].blocksize=2;
C.blocks[3].data.vec=(double *)malloc((2+1)*sizeof(double));
if (C.blocks[3].data.vec == NULL)
{
printf("Couldn't allocate storage for C!\n");
exit(1);
};
/*
* Put the entries into the third block.
*/
C.blocks[3].data.vec[1]=0.0;
C.blocks[3].data.vec[2]=0.0;
/*
* Allocate storage for the right hand side, b.
*/
b=(double *)malloc((2+1)*sizeof(double));
if (b==NULL)
{
printf("Failed to allocate storage for a!\n");
exit(1);
};
/*
* Fill in the entries in b.
*/
b[1]=1.0;
b[2]=2.0;
/*
* The next major step is to setup the two constraint matrices A1 and A2.
* Again, because C indexing starts with 0, we have to allocate space for
* one more constraint. constraints[0] is not used.
*/
constraints=(struct constraintmatrix *)malloc( (2+1)*sizeof(struct constraintmatrix));
if (constraints==NULL)
{
printf("Failed to allocate storage for constraints!\n");
exit(1);
};
/*
* Setup the A1 matrix. Note that we start with block 3 of A1 and then
* do block 1 of A1. We do this in this order because the blocks will
* be inserted into the linked list of A1 blocks in reverse order.
*/
/*
* Terminate the linked list with a NULL pointer.
*/
constraints[1].blocks=NULL;
/*
* Now, we handle block 3 of A1.
*/
/*
* Allocate space for block 3 of A1.
*/
blockptr=(struct sparseblock *)malloc(sizeof(struct sparseblock));
if (blockptr==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
/*
* Initialize block 3.
*/
blockptr->blocknum=3;
blockptr->blocksize=2;
blockptr->constraintnum=1;
blockptr->next=NULL;
blockptr->nextbyblock=NULL;
blockptr->entries=(double *) malloc((1+1)*sizeof(double));
if (blockptr->entries==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
blockptr->iindices=(int *) malloc((1+1)*sizeof(int));
if (blockptr->iindices==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
blockptr->jindices=(int *) malloc((1+1)*sizeof(int));
if (blockptr->jindices==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
/*
* We have 1 nonzero entry in the upper triangle of block 3 of A1.
*/
blockptr->numentries=1;
/*
* The entry in the 1,1 position of block 3 of A1 is 1.0
*/
blockptr->iindices[1]=1;
blockptr->jindices[1]=1;
blockptr->entries[1]=1.0;
/*
* Note that the entry in the 2,2 position of block 3 of A1 is 0,
* So we don't store anything for it.
*/
/*
* Insert block 3 into the linked list of A1 blocks.
*/
blockptr->next=constraints[1].blocks;
constraints[1].blocks=blockptr;
/*
* Now, we handle block 1.
*/
/*
* Allocate space for block 1.
*/
blockptr=(struct sparseblock *)malloc(sizeof(struct sparseblock));
if (blockptr==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
/*
* Initialize block 1.
*/
blockptr->blocknum=1;
blockptr->blocksize=2;
blockptr->constraintnum=1;
blockptr->next=NULL;
blockptr->nextbyblock=NULL;
blockptr->entries=(double *) malloc((3+1)*sizeof(double));
if (blockptr->entries==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
blockptr->iindices=(int *) malloc((3+1)*sizeof(int));
if (blockptr->iindices==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
blockptr->jindices=(int *) malloc((3+1)*sizeof(int));
if (blockptr->jindices==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
/*
* We have 3 nonzero entries in the upper triangle of block 1 of A1.
*/
blockptr->numentries=3;
/*
* The entry in the 1,1 position of block 1 of A1 is 3.0
*/
blockptr->iindices[1]=1;
blockptr->jindices[1]=1;
blockptr->entries[1]=3.0;
/*
* The entry in the 1,2 position of block 1 of A1 is 1.0
*/
blockptr->iindices[2]=1;
blockptr->jindices[2]=2;
blockptr->entries[2]=1.0;
/*
* The entry in the 2,2 position of block 1 of A1 is 3.0
*/
blockptr->iindices[3]=2;
blockptr->jindices[3]=2;
blockptr->entries[3]=3.0;
/*
* Note that we don't have to store the 2,1 entry- this is assumed to be
* equal to the 1,2 entry.
*/
/*
* Insert block 1 into the linked list of A1 blocks.
*/
blockptr->next=constraints[1].blocks;
constraints[1].blocks=blockptr;
/*
* Note that the second block of A1 is 0, so we didn't store anything for it.
*/
/*
* Setup the A2 matrix. This time, there are nonzero entries in block 3
* and block 2. We start with block 3 of A2 and then do block 1 of A2.
*/
/*
* Terminate the linked list with a NULL pointer.
*/
constraints[2].blocks=NULL;
/*
* First, we handle block 3 of A2.
*/
/*
* Allocate space for block 3 of A2.
*/
blockptr=(struct sparseblock *)malloc(sizeof(struct sparseblock));
if (blockptr==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
/*
* Initialize block 3.
*/
blockptr->blocknum=3;
blockptr->blocksize=2;
blockptr->constraintnum=2;
blockptr->next=NULL;
blockptr->nextbyblock=NULL;
blockptr->entries=(double *) malloc((1+1)*sizeof(double));
if (blockptr->entries==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
blockptr->iindices=(int *) malloc((1+1)*sizeof(int));
if (blockptr->iindices==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
blockptr->jindices=(int *) malloc((1+1)*sizeof(int));
if (blockptr->jindices==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
/*
* We have 1 nonzero entry in the upper triangle of block 3 of A2.
*/
blockptr->numentries=1;
/*
* The entry in the 2,2 position of block 3 of A2 is 1.0
*/
blockptr->iindices[1]=2;
blockptr->jindices[1]=2;
blockptr->entries[1]=1.0;
/*
* Insert block 3 into the linked list of A2 blocks.
*/
blockptr->next=constraints[2].blocks;
constraints[2].blocks=blockptr;
/*
* Now, we handle block 2.
*/
/*
* Allocate space for block 2.
*/
blockptr=(struct sparseblock *)malloc(sizeof(struct sparseblock));
if (blockptr==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
/*
* Initialize block 2.
*/
blockptr->blocknum=2;
blockptr->blocksize=3;
blockptr->constraintnum=2;
blockptr->next=NULL;
blockptr->nextbyblock=NULL;
blockptr->entries=(double *) malloc((4+1)*sizeof(double));
if (blockptr->entries==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
blockptr->iindices=(int *) malloc((4+1)*sizeof(int));
if (blockptr->iindices==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
blockptr->jindices=(int *) malloc((4+1)*sizeof(int));
if (blockptr->jindices==NULL)
{
printf("Allocation of constraint block failed!\n");
exit(1);
};
/*
* We have 4 nonzero entries in the upper triangle of block 2 of A2.
*/
blockptr->numentries=4;
/*
* The entry in the 1,1 position of block 2 of A2 is 3.0
*/
blockptr->iindices[1]=1;
blockptr->jindices[1]=1;
blockptr->entries[1]=3.0;
/*
* The entry in the 2,2 position of block 2 of A2 is 4.0
*/
blockptr->iindices[2]=2;
blockptr->jindices[2]=2;
blockptr->entries[2]=4.0;
/*
* The entry in the 3,3 position of block 2 of A2 is 5.0
*/
blockptr->iindices[3]=3;
blockptr->jindices[3]=3;
blockptr->entries[3]=5.0;
/*
* The entry in the 1,3 position of block 2 of A2 is 1.0
*/
blockptr->iindices[4]=1;
blockptr->jindices[4]=3;
blockptr->entries[4]=1.0;
/*
* Note that we don't store the 0 entries and entries below the diagonal!
*/
/*
* Insert block 2 into the linked list of A2 blocks.
*/
blockptr->next=constraints[2].blocks;
constraints[2].blocks=blockptr;
/*
* At this point, we have all of the problem data setup.
*/
/*
* Write the problem out in SDPA sparse format.
*/
write_prob("prob.dat-s",7,2,C,b,constraints);
/*
* Create an initial solution. This allocates space for X, y, and Z,
* and sets initial values.
*/
initsoln(7,2,C,b,constraints,&X,&y,&Z);
/*
* Solve the problem.
*/
ret=easy_sdp(7,2,C,b,constraints,0.0,&X,&y,&Z,&pobj,&dobj);
if (ret == 0)
printf("The objective value is %.7e \n",(dobj+pobj)/2);
else
printf("SDP failed.\n");
/*
* Write out the problem solution.
*/
write_sol("prob.sol",7,2,X,y,Z);
/*
* Free storage allocated for the problem and return.
*/
free_prob(7,2,C,b,constraints,X,y,Z);
exit(0);
}
|
53dd02b1b35957039dcc9c4c5ff3ed0ff253f871
|
58fe7cb3949dd1930e709696659a0296500b64a6
|
/tests/unit/s2n_release_non_empty_buffers_test.c
|
c2a20dcc74fa589992fdba6820bcb18aed712f8b
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
aws/s2n-tls
|
3344638a6a69c6f20665cf6847e1bc4b85f2e558
|
62dc7a6d4876e5eee0dea3690d528a4c7080a1d5
|
refs/heads/main
| 2023-08-31T23:26:33.780048
| 2023-08-31T05:17:33
| 2023-08-31T05:17:33
| 21,287,076
| 513
| 213
|
Apache-2.0
| 2023-09-13T23:52:29
| 2014-06-27T19:37:59
|
C
|
UTF-8
|
C
| false
| false
| 6,862
|
c
|
s2n_release_non_empty_buffers_test.c
|
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#include <fcntl.h>
#include <poll.h>
#include <signal.h>
#include <stdint.h>
#include <sys/wait.h>
#include <unistd.h>
#include "api/s2n.h"
#include "s2n_test.h"
#include "testlib/s2n_testlib.h"
#include "tls/s2n_connection.h"
#include "tls/s2n_handshake.h"
#include "utils/s2n_random.h"
#define MAX_BUF_SIZE 10000
static const uint8_t buf_to_send[1023] = { 27 };
int mock_client(struct s2n_test_io_pair *io_pair)
{
struct s2n_connection *conn;
struct s2n_config *client_config;
s2n_blocked_status blocked;
int result = 0;
conn = s2n_connection_new(S2N_CLIENT);
client_config = s2n_config_new();
s2n_config_disable_x509_verification(client_config);
s2n_connection_set_config(conn, client_config);
/* Unlike the server, the client just passes ownership of I/O to s2n */
s2n_connection_set_io_pair(conn, io_pair);
result = s2n_negotiate(conn, &blocked);
if (result < 0) {
_exit(1);
}
if (s2n_send(conn, buf_to_send, sizeof(buf_to_send), &blocked) != sizeof(buf_to_send)) {
_exit(2);
}
s2n_shutdown(conn, &blocked);
s2n_connection_free(conn);
s2n_config_free(client_config);
s2n_cleanup();
exit(0);
}
/**
* This test ensures that we don't allow releasing connection buffers if they contain part
* of the unprocessed record, avoiding connection corruption.
*/
int main(int argc, char **argv)
{
s2n_blocked_status blocked;
int status;
pid_t pid;
char *cert_chain_pem;
char *private_key_pem;
uint8_t buf[sizeof(buf_to_send)];
uint32_t n = 0;
ssize_t ret = 0;
BEGIN_TEST();
EXPECT_SUCCESS(s2n_disable_tls13_in_test());
/* Create a pipe */
struct s2n_test_io_pair io_pair;
EXPECT_SUCCESS(s2n_io_pair_init(&io_pair));
/* Create a child process */
pid = fork();
if (pid == 0) {
/* This is the client process, close the server end of the pipe */
EXPECT_SUCCESS(s2n_io_pair_close_one_end(&io_pair, S2N_SERVER));
/* Run the client */
mock_client(&io_pair);
}
DEFER_CLEANUP(struct s2n_config *config = s2n_config_new(),
s2n_config_ptr_free);
DEFER_CLEANUP(struct s2n_connection *conn = s2n_connection_new(S2N_SERVER),
s2n_connection_ptr_free);
DEFER_CLEANUP(struct s2n_cert_chain_and_key *chain_and_key = s2n_cert_chain_and_key_new(),
s2n_cert_chain_and_key_ptr_free);
DEFER_CLEANUP(struct s2n_stuffer in, s2n_stuffer_free);
DEFER_CLEANUP(struct s2n_stuffer out, s2n_stuffer_free);
EXPECT_NOT_NULL(cert_chain_pem = malloc(S2N_MAX_TEST_PEM_SIZE));
EXPECT_NOT_NULL(private_key_pem = malloc(S2N_MAX_TEST_PEM_SIZE));
EXPECT_SUCCESS(s2n_read_test_pem(S2N_DEFAULT_TEST_CERT_CHAIN, cert_chain_pem, S2N_MAX_TEST_PEM_SIZE));
EXPECT_SUCCESS(s2n_read_test_pem(S2N_DEFAULT_TEST_PRIVATE_KEY, private_key_pem, S2N_MAX_TEST_PEM_SIZE));
EXPECT_SUCCESS(s2n_cert_chain_and_key_load_pem(chain_and_key, cert_chain_pem, private_key_pem));
EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(config, chain_and_key));
/* This is the server process, close the client end of the pipe */
EXPECT_SUCCESS(s2n_io_pair_close_one_end(&io_pair, S2N_CLIENT));
EXPECT_SUCCESS(s2n_connection_set_config(conn, config));
/* Make pipes non-blocking */
EXPECT_SUCCESS(s2n_fd_set_non_blocking(io_pair.server));
EXPECT_SUCCESS(s2n_fd_set_non_blocking(io_pair.server));
/* Set up our I/O callbacks. Use stuffers for the "I/O context" */
EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&in, 0));
EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&out, 0));
EXPECT_SUCCESS(s2n_connection_set_io_stuffers(&in, &out, conn));
/* Negotiate the handshake. */
do {
ret = s2n_negotiate(conn, &blocked);
EXPECT_TRUE(ret == 0 || (blocked && (errno == EAGAIN || errno == EWOULDBLOCK)));
/* check to see if we need to copy more over from the pipes to the buffers
* to continue the handshake */
s2n_stuffer_recv_from_fd(&in, io_pair.server, MAX_BUF_SIZE, NULL);
s2n_stuffer_send_to_fd(&out, io_pair.server, s2n_stuffer_data_available(&out), NULL);
} while (blocked);
/* Receive only 100 bytes of the record and try to call s2n_recv */
while (n < 100) {
ret = s2n_stuffer_recv_from_fd(&in, io_pair.server, 100 - n, &n);
if (errno == EAGAIN || errno == EWOULDBLOCK) {
continue;
} else {
POSIX_GUARD(ret);
}
}
/* s2n_recv should fail as we received only part of the record */
EXPECT_FAILURE(s2n_recv(conn, buf, sizeof(buf), &blocked));
EXPECT_TRUE(blocked == S2N_BLOCKED_ON_READ);
/* Now try to release the buffers and expect failure as buffers are not empty */
EXPECT_FAILURE(s2n_connection_release_buffers(conn));
/* Read the rest of the buffer and expect s2n_recv to succeed */
do {
ret = s2n_stuffer_recv_from_fd(&in, io_pair.server, MAX_BUF_SIZE, NULL);
if (errno == EAGAIN || errno == EWOULDBLOCK) {
continue;
} else {
POSIX_GUARD(ret);
}
ret = s2n_recv(conn, buf, sizeof(buf), &blocked);
} while (ret < 0 && s2n_error_get_type(s2n_errno) == S2N_ERR_T_BLOCKED
&& blocked == S2N_BLOCKED_ON_READ);
/* Expect that we read the data client sent us */
EXPECT_TRUE(ret == sizeof(buf_to_send));
EXPECT_TRUE(memcmp(buf, buf_to_send, ret) == 0);
/* Since full record was processed, we should be able to release buffers */
EXPECT_SUCCESS(s2n_connection_release_buffers(conn));
/* Shutdown after negotiating */
uint8_t server_shutdown = 0;
do {
ret = s2n_shutdown(conn, &blocked);
EXPECT_TRUE(ret == 0 || (blocked && (errno == EAGAIN || errno == EWOULDBLOCK)));
if (ret == 0) {
server_shutdown = 1;
}
s2n_stuffer_recv_from_fd(&in, io_pair.server, MAX_BUF_SIZE, NULL);
s2n_stuffer_send_to_fd(&out, io_pair.server, s2n_stuffer_data_available(&out), NULL);
} while (!server_shutdown);
EXPECT_EQUAL(waitpid(-1, &status, 0), pid);
EXPECT_EQUAL(status, 0);
/* Clean up */
free(cert_chain_pem);
free(private_key_pem);
s2n_cleanup();
END_TEST();
return 0;
}
|
f3a59cc779794adb92c4039373b84337481fc5b3
|
e73547787354afd9b717ea57fe8dd0695d161821
|
/include/mapfs/hos_02_shape.h
|
77b6895d9cde34a38c8d3473a8fad82ce824533e
|
[] |
no_license
|
pmret/papermario
|
8b514b19653cef8d6145e47499b3636b8c474a37
|
9774b26d93f1045dd2a67e502b6efc9599fb6c31
|
refs/heads/main
| 2023-08-31T07:09:48.951514
| 2023-08-21T18:07:08
| 2023-08-21T18:07:08
| 287,151,133
| 904
| 139
| null | 2023-09-14T02:44:23
| 2020-08-13T01:22:57
|
C
|
UTF-8
|
C
| false
| false
| 3,672
|
h
|
hos_02_shape.h
|
#define MODEL_Root 0x60
#define MODEL_g182 0x5F
#define MODEL_g199 0x5E
#define MODEL_g190 0x5D
#define MODEL_o540 0x5C
#define MODEL_g188 0x5B
#define MODEL_o539 0x5A
#define MODEL_g198 0x59
#define MODEL_o548 0x58
#define MODEL_g197 0x57
#define MODEL_o547 0x56
#define MODEL_g196 0x55
#define MODEL_o546 0x54
#define MODEL_g195 0x53
#define MODEL_o545 0x52
#define MODEL_g194 0x51
#define MODEL_o544 0x50
#define MODEL_g193 0x4F
#define MODEL_o543 0x4E
#define MODEL_g192 0x4D
#define MODEL_o542 0x4C
#define MODEL_g191 0x4B
#define MODEL_o541 0x4A
#define MODEL_g163 0x49
#define MODEL_o472 0x48
#define MODEL_g162 0x47
#define MODEL_o471 0x46
#define MODEL_g161 0x45
#define MODEL_o470 0x44
#define MODEL_g160 0x43
#define MODEL_o469 0x42
#define MODEL_g159 0x41
#define MODEL_o468 0x40
#define MODEL_g158 0x3F
#define MODEL_o467 0x3E
#define MODEL_g157 0x3D
#define MODEL_o466 0x3C
#define MODEL_g164 0x3B
#define MODEL_g175 0x3A
#define MODEL_g179 0x39
#define MODEL_o348 0x38
#define MODEL_g178 0x37
#define MODEL_o347 0x36
#define MODEL_g177 0x35
#define MODEL_o458 0x34
#define MODEL_o457 0x33
#define MODEL_o456 0x32
#define MODEL_g176 0x31
#define MODEL_o465 0x30
#define MODEL_o464 0x2F
#define MODEL_o463 0x2E
#define MODEL_o462 0x2D
#define MODEL_o461 0x2C
#define MODEL_o460 0x2B
#define MODEL_o459 0x2A
#define MODEL_g170 0x29
#define MODEL_g174 0x28
#define MODEL_o398 0x27
#define MODEL_g173 0x26
#define MODEL_o399 0x25
#define MODEL_g172 0x24
#define MODEL_o448 0x23
#define MODEL_o447 0x22
#define MODEL_o446 0x21
#define MODEL_g171 0x20
#define MODEL_o455 0x1F
#define MODEL_o454 0x1E
#define MODEL_o453 0x1D
#define MODEL_o452 0x1C
#define MODEL_o451 0x1B
#define MODEL_o450 0x1A
#define MODEL_o449 0x19
#define MODEL_g165 0x18
#define MODEL_g169 0x17
#define MODEL_o415 0x16
#define MODEL_g168 0x15
#define MODEL_o414 0x14
#define MODEL_g167 0x13
#define MODEL_o413 0x12
#define MODEL_o408 0x11
#define MODEL_o407 0x10
#define MODEL_g166 0xF
#define MODEL_o424 0xE
#define MODEL_o416 0xD
#define MODEL_o417 0xC
#define MODEL_o419 0xB
#define MODEL_o418 0xA
#define MODEL_o409 0x9
#define MODEL_o425 0x8
#define MODEL_g1 0x7
#define MODEL_o552 0x6
#define MODEL_o549 0x5
#define MODEL_o395 0x4
#define MODEL_g186 0x3
#define MODEL_g183 0x2
#define MODEL_o380 0x1
#define MODEL_o482 0x0
|
7dd8bc895925ef6ad644140bf7d7fa30a427c2c8
|
f3eed0234b4d0ad2bbb2abd700cf1e2c7a0e8a1d
|
/AKWF-c/AKWF_altosax/AKWF_altosax_0011.h
|
05588e237407d83785ce5d0f667aa45a9f221bf7
|
[
"CC0-1.0"
] |
permissive
|
KristofferKarlAxelEkstrand/AKWF-FREE
|
b2defa1a2d389d309be6dd2e9f968923daf80d1b
|
cf8171df36e9fec25416b5f568b72a6e2cb69194
|
refs/heads/master
| 2023-07-23T18:22:36.939705
| 2023-07-10T17:14:40
| 2023-07-10T17:14:40
| 145,817,187
| 359
| 59
|
CC0-1.0
| 2023-07-10T17:14:41
| 2018-08-23T07:26:56
| null |
UTF-8
|
C
| false
| false
| 4,688
|
h
|
AKWF_altosax_0011.h
|
/* Adventure Kid Waveforms (AKWF) converted for use with Teensy Audio Library
*
* Adventure Kid Waveforms(AKWF) Open waveforms library
* https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/
*
* This code is in the public domain, CC0 1.0 Universal (CC0 1.0)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* Converted by Brad Roy, https://github.com/prosper00
*/
/* AKWF_altosax_0011 256 samples
+-----------------------------------------------------------------------------------------------------------------+
| **** **** |
| *** ** |
| ** *** |
| ** ** |
| ** ** |
| ** ** |
| ** ** |
| ** * |
|** ** |
|* ** ********** |
| ** *** *** *|
| *** *** **** *** ***|
| ** ** **** ******** ******** **** |
| ** ** ************ ******* |
| ** *** |
+-----------------------------------------------------------------------------------------------------------------+
*/
const uint16_t AKWF_altosax_0011 [] = {
33094, 34174, 35224, 36483, 37818, 39092, 40354, 41698, 43157, 44718, 46278, 47766, 49080, 50304, 51692, 53264,
54836, 56187, 57329, 58333, 59406, 60408, 61217, 61841, 62349, 62789, 63250, 63648, 63933, 64190, 64350, 64521,
64842, 65206, 65467, 65533, 65322, 64875, 64325, 63832, 63401, 62966, 62418, 61710, 60902, 59988, 59000, 58141,
57410, 56663, 55821, 54768, 53569, 52285, 50970, 49674, 48328, 46914, 45379, 43799, 42161, 40493, 38915, 37495,
36200, 35037, 33998, 32916, 31832, 30669, 29526, 28497, 27622, 26830, 25993, 24940, 23717, 22639, 21741, 20990,
20268, 19486, 18543, 17610, 17050, 16917, 16984, 16942, 16715, 16338, 15976, 15886, 16007, 16123, 16265, 16399,
16592, 17013, 17539, 18171, 18827, 19485, 20161, 20885, 21717, 22666, 23457, 23956, 24399, 25031, 25813, 26595,
27224, 27613, 28085, 28725, 29436, 30139, 30842, 31391, 31870, 32376, 32912, 33439, 33908, 34311, 34601, 34797,
34925, 35112, 35236, 35166, 35030, 35008, 35025, 35155, 35167, 34979, 34722, 34479, 34292, 34158, 33990, 33652,
33234, 32733, 32166, 31687, 31290, 30840, 30383, 29851, 29328, 28799, 28318, 27873, 27445, 27025, 26489, 25891,
25315, 24868, 24473, 24169, 23893, 23512, 23042, 22673, 22480, 22384, 22322, 22165, 21945, 21797, 21728, 21651,
21535, 21484, 21541, 21654, 21719, 21664, 21650, 21769, 22062, 22473, 22792, 22923, 23019, 23207, 23481, 23785,
24045, 24344, 24642, 24845, 25071, 25345, 25600, 25840, 25989, 26105, 26285, 26476, 26543, 26611, 26736, 26826,
26905, 26914, 26846, 26747, 26646, 26497, 26340, 26154, 25916, 25708, 25582, 25427, 25174, 24906, 24716, 24601,
24501, 24287, 23977, 23766, 23570, 23385, 23225, 23048, 22896, 22745, 22615, 22575, 22615, 22635, 22701, 22828,
22994, 23211, 23445, 23721, 24048, 24443, 24913, 25497, 26158, 26833, 27522, 28318, 29149, 30048, 30930, 32030,
};
|
6ecb13293205e18c3fddae9fc85ec685a56b754d
|
42ab733e143d02091d13424fb4df16379d5bba0d
|
/third_party/libsdl2/include/SDL_surface.h
|
45e5366fe51398d0d057c5930311c35a240d0f99
|
[
"Apache-2.0",
"CC0-1.0",
"LicenseRef-scancode-unknown-license-reference",
"Zlib"
] |
permissive
|
google/filament
|
11cd37ac68790fcf8b33416b7d8d8870e48181f0
|
0aa0efe1599798d887fa6e33c412c09e81bea1bf
|
refs/heads/main
| 2023-08-29T17:58:22.496956
| 2023-08-28T17:27:38
| 2023-08-28T17:27:38
| 143,455,116
| 16,631
| 1,961
|
Apache-2.0
| 2023-09-14T16:23:39
| 2018-08-03T17:26:00
|
C++
|
UTF-8
|
C
| false
| false
| 20,307
|
h
|
SDL_surface.h
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
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.
*/
/**
* \file SDL_surface.h
*
* Header file for ::SDL_Surface definition and management functions.
*/
#ifndef SDL_surface_h_
#define SDL_surface_h_
#include "SDL_stdinc.h"
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "SDL_blendmode.h"
#include "SDL_rwops.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \name Surface flags
*
* These are the currently supported flags for the ::SDL_Surface.
*
* \internal
* Used internally (read-only).
*/
/* @{ */
#define SDL_SWSURFACE 0 /**< Just here for compatibility */
#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
/* @} *//* Surface flags */
/**
* Evaluates to true if the surface needs to be locked before access.
*/
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
/**
* \brief A collection of pixels used in software blitting.
*
* \note This structure should be treated as read-only, except for \c pixels,
* which, if not NULL, contains the raw pixel data for the surface.
*/
typedef struct SDL_Surface
{
Uint32 flags; /**< Read-only */
SDL_PixelFormat *format; /**< Read-only */
int w, h; /**< Read-only */
int pitch; /**< Read-only */
void *pixels; /**< Read-write */
/** Application data associated with the surface */
void *userdata; /**< Read-write */
/** information needed for surfaces requiring locks */
int locked; /**< Read-only */
void *lock_data; /**< Read-only */
/** clipping information */
SDL_Rect clip_rect; /**< Read-only */
/** info for fast blit mapping to other surfaces */
struct SDL_BlitMap *map; /**< Private */
/** Reference count -- used when freeing surface */
int refcount; /**< Read-mostly */
} SDL_Surface;
/**
* \brief The type of function used for surface blitting functions.
*/
typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
struct SDL_Surface * dst, SDL_Rect * dstrect);
/**
* \brief The formula used for converting between YUV and RGB
*/
typedef enum
{
SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */
SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */
SDL_YUV_CONVERSION_BT709, /**< BT.709 */
SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */
} SDL_YUV_CONVERSION_MODE;
/**
* Allocate and free an RGB surface.
*
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
* If the depth is greater than 8 bits, the pixel format is set using the
* flags '[RGB]mask'.
*
* If the function runs out of memory, it will return NULL.
*
* \param flags The \c flags are obsolete and should be set to 0.
* \param width The width in pixels of the surface to create.
* \param height The height in pixels of the surface to create.
* \param depth The depth in bits of the surface to create.
* \param Rmask The red mask of the surface to create.
* \param Gmask The green mask of the surface to create.
* \param Bmask The blue mask of the surface to create.
* \param Amask The alpha mask of the surface to create.
*/
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
(Uint32 flags, int width, int height, int depth,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
(Uint32 flags, int width, int height, int depth, Uint32 format);
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
int width,
int height,
int depth,
int pitch,
Uint32 Rmask,
Uint32 Gmask,
Uint32 Bmask,
Uint32 Amask);
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom
(void *pixels, int width, int height, int depth, int pitch, Uint32 format);
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
/**
* \brief Set the palette used by a surface.
*
* \return 0, or -1 if the surface format doesn't use a palette.
*
* \note A single palette can be shared with many surfaces.
*/
extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
SDL_Palette * palette);
/**
* \brief Sets up a surface for directly accessing the pixels.
*
* Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
* to and read from \c surface->pixels, using the pixel format stored in
* \c surface->format. Once you are done accessing the surface, you should
* use SDL_UnlockSurface() to release it.
*
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
* to 0, then you can read and write to the surface at any time, and the
* pixel format of the surface will not change.
*
* No operating system or library calls should be made between lock/unlock
* pairs, as critical system locks may be held during this time.
*
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
*
* \sa SDL_UnlockSurface()
*/
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
/** \sa SDL_LockSurface() */
extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
/**
* Load a surface from a seekable SDL data stream (memory or file).
*
* If \c freesrc is non-zero, the stream will be closed after being read.
*
* The new surface should be freed with SDL_FreeSurface().
*
* \return the new surface, or NULL if there was an error.
*/
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
int freesrc);
/**
* Load a surface from a file.
*
* Convenience macro.
*/
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
/**
* Save a surface to a seekable SDL data stream (memory or file).
*
* Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
* BMP directly. Other RGB formats with 8-bit or higher get converted to a
* 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
* surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
* not supported.
*
* If \c freedst is non-zero, the stream will be closed after being written.
*
* \return 0 if successful or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
(SDL_Surface * surface, SDL_RWops * dst, int freedst);
/**
* Save a surface to a file.
*
* Convenience macro.
*/
#define SDL_SaveBMP(surface, file) \
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
/**
* \brief Sets the RLE acceleration hint for a surface.
*
* \return 0 on success, or -1 if the surface is not valid
*
* \note If RLE is enabled, colorkey and alpha blending blits are much faster,
* but the surface must be locked before directly accessing the pixels.
*/
extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
int flag);
/**
* \brief Sets the color key (transparent pixel) in a blittable surface.
*
* \param surface The surface to update
* \param flag Non-zero to enable colorkey and 0 to disable colorkey
* \param key The transparent pixel in the native surface format
*
* \return 0 on success, or -1 if the surface is not valid
*
* You can pass SDL_RLEACCEL to enable RLE accelerated blits.
*/
extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
int flag, Uint32 key);
/**
* \brief Gets the color key (transparent pixel) in a blittable surface.
*
* \param surface The surface to update
* \param key A pointer filled in with the transparent pixel in the native
* surface format
*
* \return 0 on success, or -1 if the surface is not valid or colorkey is not
* enabled.
*/
extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
Uint32 * key);
/**
* \brief Set an additional color value used in blit operations.
*
* \param surface The surface to update.
* \param r The red color value multiplied into blit operations.
* \param g The green color value multiplied into blit operations.
* \param b The blue color value multiplied into blit operations.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_GetSurfaceColorMod()
*/
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
Uint8 r, Uint8 g, Uint8 b);
/**
* \brief Get the additional color value used in blit operations.
*
* \param surface The surface to query.
* \param r A pointer filled in with the current red color value.
* \param g A pointer filled in with the current green color value.
* \param b A pointer filled in with the current blue color value.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceColorMod()
*/
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
Uint8 * r, Uint8 * g,
Uint8 * b);
/**
* \brief Set an additional alpha value used in blit operations.
*
* \param surface The surface to update.
* \param alpha The alpha value multiplied into blit operations.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_GetSurfaceAlphaMod()
*/
extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
Uint8 alpha);
/**
* \brief Get the additional alpha value used in blit operations.
*
* \param surface The surface to query.
* \param alpha A pointer filled in with the current alpha value.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceAlphaMod()
*/
extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
Uint8 * alpha);
/**
* \brief Set the blend mode used for blit operations.
*
* \param surface The surface to update.
* \param blendMode ::SDL_BlendMode to use for blit blending.
*
* \return 0 on success, or -1 if the parameters are not valid.
*
* \sa SDL_GetSurfaceBlendMode()
*/
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
SDL_BlendMode blendMode);
/**
* \brief Get the blend mode used for blit operations.
*
* \param surface The surface to query.
* \param blendMode A pointer filled in with the current blend mode.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceBlendMode()
*/
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
SDL_BlendMode *blendMode);
/**
* Sets the clipping rectangle for the destination surface in a blit.
*
* If the clip rectangle is NULL, clipping will be disabled.
*
* If the clip rectangle doesn't intersect the surface, the function will
* return SDL_FALSE and blits will be completely clipped. Otherwise the
* function returns SDL_TRUE and blits to the surface will be clipped to
* the intersection of the surface area and the clipping rectangle.
*
* Note that blits are automatically clipped to the edges of the source
* and destination surfaces.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
const SDL_Rect * rect);
/**
* Gets the clipping rectangle for the destination surface in a blit.
*
* \c rect must be a pointer to a valid rectangle which will be filled
* with the correct values.
*/
extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
SDL_Rect * rect);
/*
* Creates a new surface identical to the existing surface
*/
extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface);
/**
* Creates a new surface of the specified format, and then copies and maps
* the given surface to it so the blit of the converted surface will be as
* fast as possible. If this function fails, it returns NULL.
*
* The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
* semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
* surface.
*/
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
(SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags);
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
(SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
/**
* \brief Copy a block of pixels of one format to another format
*
* \return 0 on success, or -1 if there was an error
*/
extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
Uint32 src_format,
const void * src, int src_pitch,
Uint32 dst_format,
void * dst, int dst_pitch);
/**
* Performs a fast fill of the given rectangle with \c color.
*
* If \c rect is NULL, the whole surface will be filled with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_FillRect
(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
extern DECLSPEC int SDLCALL SDL_FillRects
(SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
/**
* Performs a fast blit from the source surface to the destination surface.
*
* This assumes that the source and destination rectangles are
* the same size. If either \c srcrect or \c dstrect are NULL, the entire
* surface (\c src or \c dst) is copied. The final blit rectangles are saved
* in \c srcrect and \c dstrect after all clipping is performed.
*
* \return If the blit is successful, it returns 0, otherwise it returns -1.
*
* The blit function should not be called on a locked surface.
*
* The blit semantics for surfaces with and without blending and colorkey
* are defined as follows:
* \verbatim
RGBA->RGB:
Source surface blend mode set to SDL_BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to SDL_BLENDMODE_NONE:
copy RGB.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGBA:
Source surface blend mode set to SDL_BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to SDL_BLENDMODE_NONE:
copy RGB, set destination alpha to source per-surface alpha value.
both:
if SDL_SRCCOLORKEY set, only copy the pixels matching the
source color key.
RGBA->RGBA:
Source surface blend mode set to SDL_BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to SDL_BLENDMODE_NONE:
copy all of RGBA to the destination.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGB:
Source surface blend mode set to SDL_BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to SDL_BLENDMODE_NONE:
copy RGB.
both:
if SDL_SRCCOLORKEY set, only copy the pixels matching the
source color key.
\endverbatim
*
* You should call SDL_BlitSurface() unless you know exactly how SDL
* blitting works internally and how to use the other blit functions.
*/
#define SDL_BlitSurface SDL_UpperBlit
/**
* This is the public blit function, SDL_BlitSurface(), and it performs
* rectangle validation and clipping before passing it to SDL_LowerBlit()
*/
extern DECLSPEC int SDLCALL SDL_UpperBlit
(SDL_Surface * src, const SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
/**
* This is a semi-private blit function and it performs low-level surface
* blitting only.
*/
extern DECLSPEC int SDLCALL SDL_LowerBlit
(SDL_Surface * src, SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
/**
* \brief Perform a fast, low quality, stretch blit between two surfaces of the
* same pixel format.
*
* \note This function uses a static buffer, and is not thread-safe.
*/
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
const SDL_Rect * srcrect,
SDL_Surface * dst,
const SDL_Rect * dstrect);
#define SDL_BlitScaled SDL_UpperBlitScaled
/**
* This is the public scaled blit function, SDL_BlitScaled(), and it performs
* rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
*/
extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
(SDL_Surface * src, const SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
/**
* This is a semi-private blit function and it performs low-level surface
* scaled blitting only.
*/
extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
(SDL_Surface * src, SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
/**
* \brief Set the YUV conversion mode
*/
extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
/**
* \brief Get the YUV conversion mode
*/
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
/**
* \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
*/
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* SDL_surface_h_ */
/* vi: set ts=4 sw=4 expandtab: */
|
7192226a4bad3d9dc26935542e0e9cd2dd7e611b
|
0317ceaef72e61fb06061ab27d887c04c071e147
|
/firmware/apps/alarm.h
|
343d074d77ef96313464efac68d0210f46be23af
|
[
"LicenseRef-scancode-warranty-disclaimer"
] |
no_license
|
travisgoodspeed/goodwatch
|
16df7f55768d775a12898719360663315a215162
|
60673a72eaed8878cf79b56a9efcb623a1e7d2f4
|
refs/heads/master
| 2023-07-05T19:08:51.138235
| 2022-11-22T00:55:09
| 2022-11-22T00:55:09
| 87,991,182
| 468
| 60
| null | 2022-11-22T00:55:10
| 2017-04-12T00:21:21
|
C
|
UTF-8
|
C
| false
| false
| 315
|
h
|
alarm.h
|
/*! \file alarm.h
\brief alarm application.
*/
//! Initialize the alarm.
void alarm_init();
//! Exit to the next application.
int alarm_exit();
//! Draw the alarm.
void alarm_draw();
//! A button has been pressed for the alarm.
int alarm_keypress(char ch);
//! Toggle the alarm
void toggle_alarm(int enable);
|
4418113bfbb286423a50c66f176580ec4b0e6ae2
|
7fcb614a59a138019b2845a6e493f9d22c44852d
|
/MCUME_teensy/teensygnuboy/memory.c
|
7eb2cc33ecc8b0e25fb277e99f723938e32a424c
|
[] |
no_license
|
Jean-MarcHarvengt/MCUME
|
9180feaf8195c6a0a38eba6c12733c987fa98062
|
fe1280985d9a86bfb2166842a56c8eec768aa666
|
refs/heads/master
| 2023-06-09T23:11:04.216374
| 2023-05-28T15:24:02
| 2023-05-28T15:24:02
| 203,546,040
| 318
| 43
| null | 2023-03-21T13:19:51
| 2019-08-21T08:58:23
|
C
|
UTF-8
|
C
| false
| false
| 614
|
c
|
memory.c
|
#include "shared.h"
//static uint8 lvram[0x10000];
//uint8 * vram=&lvram[0];
//byte ***mpatpix;
//byte lpatpix[4096][8][8];
void mem_init(void) {
/*
mpatpix = &lpatpix[0];
int i;
for(i = 0; i < 4096; i++) {
mpatpix[i] = &lpatpix[i];
int j;
for(j = 0; j < 8; j++) {
mpatpix[i][j] = &lpatpix[i][j];
int k;
for(k = 0; k < 8; k++) {
mpatpix[i][j][k] = &lpatpix[i][j][k];
mpatpix[i][j][k]=0;
}
}
}
*/
}
int mem_test(void) {
return 1;
}
void memcpy_rom(int dst, int src, int size) {
while (size > 0) {
write_rom(dst++, read_rom(src++));
size--;
}
}
|
642bf9ed4cd9bc6a5cb7c3ae5658f45925a6fac1
|
f367e4b66a1ee42e85830b31df88f63723c36a47
|
/tests/runtime/data/stackdriver/stackdriver_test_trace.h
|
15c7bc911bacaabcdb34811aa50cb94e2e7a533c
|
[
"Apache-2.0"
] |
permissive
|
fluent/fluent-bit
|
06873e441162b92941024e9a7e9e8fc934150bf7
|
1a41f49dc2f3ae31a780caa9ffd6137b1d703065
|
refs/heads/master
| 2023-09-05T13:44:55.347372
| 2023-09-05T10:14:33
| 2023-09-05T10:14:33
| 29,933,948
| 4,907
| 1,565
|
Apache-2.0
| 2023-09-14T10:17:02
| 2015-01-27T20:41:52
|
C
|
UTF-8
|
C
| false
| false
| 108
|
h
|
stackdriver_test_trace.h
|
#define TRACE_COMMON_CASE "[" \
"1591111124," \
"{" \
"\"trace\": \"test-trace-id-xyz\"" \
"}]"
|
4bd3a41aaf0aa85a34d7e6b86830367b300333f5
|
9907672fcd81ab73ac63b2a83422a82bf31eadde
|
/aizu/tyama_aizu0202.c
|
6fbbe84dbe0985bc5be88a5135d554a77d96056b
|
[
"0BSD"
] |
permissive
|
cielavenir/procon
|
bbe1974b9bddb51b76d58722a0686a5b477c4456
|
746e1a91f574f20647e8aaaac0d9e6173f741176
|
refs/heads/master
| 2023-06-21T23:11:24.562546
| 2023-06-11T13:15:15
| 2023-06-11T13:15:15
| 7,557,464
| 137
| 136
| null | 2020-10-20T09:35:52
| 2013-01-11T09:40:26
|
C++
|
UTF-8
|
C
| false
| false
| 293
|
c
|
tyama_aizu0202.c
|
#define M 1000001
T[M],t[M],a;main(m,n,x,i,j){
for(i=2;i<M;i++)if(!T[i])for(j=i*2;j<M;j+=i)T[j]=1;
for(;scanf("%d%d",&n,&x),n;printf(m?"%d\n":"NA\n",m))
for(memset(t,0,sizeof(t)),t[0]=1,m=i=0;i<n;i++)
for(scanf("%d",&a),j=0;j+a<=x;j++)if(t[j])if(t[j+a]=1,!T[j+a]&&m<j+a)m=j+a;
exit(0);}
|
8686848b83f6e6085b4d493b2182f640a7730a0e
|
a97894ae5ecd1a31a137349dc4155130c58d4947
|
/MIP/third-party/substitute/lib/cbit/vec.h
|
fe8df716c9c38f22f487454ff0bfcf4615bc0871
|
[
"LicenseRef-scancode-other-copyleft",
"LGPL-2.1-only",
"LGPL-3.0-only",
"LicenseRef-scancode-public-domain",
"GPL-3.0-only",
"LGPL-2.1-or-later",
"MIT"
] |
permissive
|
LIJI32/MIP
|
a8cf1d2cce0ca9a5e2478445ced3610423f76970
|
526e8467665850effd847fb4cd02fdbc934b179f
|
refs/heads/master
| 2022-10-24T13:32:42.502028
| 2022-10-15T15:14:54
| 2022-10-15T15:14:54
| 84,120,291
| 171
| 24
|
MIT
| 2022-10-22T12:36:26
| 2017-03-06T21:00:09
|
C
|
UTF-8
|
C
| false
| false
| 4,509
|
h
|
vec.h
|
#pragma once
#include "misc.h"
#include <stdlib.h>
#include <string.h>
struct vec_internal {
size_t length;
size_t capacity;
void *els;
char storage[1]; // must be at least one byte so vec_free works correctly
};
#ifdef __cplusplus
extern "C" {
#endif
void vec_realloc_internal(struct vec_internal *vi, size_t new_capacity,
size_t esize);
void vec_realloc_internal_as_necessary(struct vec_internal *vi,
size_t min_capacity,
size_t esize);
#ifdef __cplusplus
}
#endif
#define DECL_VEC(ty, name) \
typedef ty __VEC_TY_##name; \
struct vec_##name { \
union { \
struct vec_internal vi; \
struct { \
size_t length; \
size_t capacity; \
VEC_TY(name) *els; \
VEC_TY(name) storage[1]; \
}; \
}; \
}; \
UNUSED_STATIC_INLINE \
void vec_free_storage_##name(struct vec_##name *v) { \
if (v->els != v->storage) \
free(v->els); \
} \
UNUSED_STATIC_INLINE \
struct vec_##name vec_borrow##name(VEC_TY(name) *els, size_t length) { \
struct vec_##name v; \
v.length = v.capacity = length; \
v.els = els; \
return v; \
} \
UNUSED_STATIC_INLINE \
void vec_realloc_##name(struct vec_##name *v, size_t new_capacity) { \
vec_realloc_internal(&v->vi, new_capacity, sizeof(v->els[0])); \
} \
UNUSED_STATIC_INLINE \
void vec_resize_##name(struct vec_##name *v, size_t new_length) { \
if (new_length >= v->capacity || new_length < v->capacity / 3) \
vec_realloc_internal_as_necessary(&v->vi, new_length, \
sizeof(v->els[0])); \
v->length = new_length; \
} \
UNUSED_STATIC_INLINE \
VEC_TY(name) *vec_appendp_##name(struct vec_##name *v) { \
size_t i = v->length++; \
if (i == v->capacity) \
vec_realloc_internal_as_necessary(&v->vi, i + 1, sizeof(v->els[0])); \
return &v->els[i]; \
} \
UNUSED_STATIC_INLINE \
void vec_append_##name(struct vec_##name *v, VEC_TY(name) val) { \
*vec_appendp_##name(v) = val; \
} \
UNUSED_STATIC_INLINE \
VEC_TY(name) vec_pop_##name(struct vec_##name *v) { \
size_t i = v->length - 1; \
VEC_TY(name) ret = v->els[i]; \
if (v->els != v->storage && i < v->capacity / 3) \
vec_realloc_internal_as_necessary(&v->vi, i, sizeof(v->els[0])); \
v->length = i; \
return ret; \
} \
UNUSED_STATIC_INLINE \
void vec_concat_##name(struct vec_##name *v1, const struct vec_##name *v2) { \
size_t l1 = v1->length, l2 = v2->length; \
vec_resize_##name(v1, safe_add(l1, l2)); \
memcpy(&v1->els[l1], v2->els, l2 * sizeof(v1->els[0])); \
} \
UNUSED_STATIC_INLINE \
void vec_add_space_##name(struct vec_##name *v, size_t idx, size_t num) { \
/* todo optimize */ \
size_t orig = v->length; \
vec_resize_##name(v, orig + num); \
memmove(&v->els[idx + num], &v->els[idx], \
(orig - idx) * sizeof(v->els[0])); \
} \
UNUSED_STATIC_INLINE \
void vec_remove_##name(struct vec_##name *v, size_t idx, size_t num) { \
/* todo optimize */ \
size_t orig = v->length; \
memmove(&v->els[idx], &v->els[idx + num], \
(orig - (idx + num)) * sizeof(v->els[0])); \
vec_resize_##name(v, orig - num); \
} \
typedef char __plz_end_decl_vec_with_semicolon_##name
#define VEC_TY(name) __VEC_TY_##name
#define VEC_STORAGE_CAPA(name, n) \
struct { \
struct vec_##name v; \
VEC_TY(name) rest[(n)-1]; \
}
#define VEC_STORAGE(ty) \
VEC_STORAGE_CAPA(ty, 5)
#define VEC_STORAGE_INIT(vs, name) do { \
struct vec_##name *v = &(vs)->v; \
v->length = 0; \
v->capacity = (sizeof((vs)->rest) / sizeof(VEC_TY(name))) + 1; \
v->els = v->storage; \
} while (0)
#define VEC_STORAGE_INIT_STATIC(vs, name) \
{{0, \
(sizeof((vs)->rest) / sizeof((vs)->rest[0])) + 1, \
(vs)->v.storage \
}}
/* guaranteed to *not* cache vec->length - pretty simple */
#define VEC_FOREACH(vec, idx_var, ptr_var, name) \
LET(struct vec_##name *__vfe_v = (vec)) \
for (size_t idx_var = 0; idx_var < __vfe_v->length; idx_var++) \
LET_LOOP(ptr_var = &__vfe_v->els[idx_var])
|
dcdc7460291f2465e260b4c6b1fd435bf3cca014
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/arch/arm/src/efm32/efm32_gpioirq.c
|
6f22fbec7af5dcc5f344d9d8a806e9bdbeec70f8
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 9,530
|
c
|
efm32_gpioirq.c
|
/****************************************************************************
* arch/arm/src/efm32/efm32_gpioirq.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include "arm_internal.h"
#include "hardware/efm32_gpio.h"
#include "efm32_gpio.h"
#include "efm32_bitband.h"
#ifdef CONFIG_EFM32_GPIO_IRQ
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: efm32_getport
*
* Description:
* Extract the encoded port number
*
****************************************************************************/
static inline uint8_t efm32_getport(gpio_pinset_t cfgset)
{
return (uint8_t)((cfgset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT);
}
/****************************************************************************
* Name: efm32_getpin
*
* Description:
* Extract the encoded pin number
*
****************************************************************************/
static inline uint8_t efm32_getpin(gpio_pinset_t cfgset)
{
return (uint8_t)((cfgset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT);
}
/****************************************************************************
* Name: efm32_gpio_interrupt
*
* Description:
* Common GPIO interrupt handling logic
*
****************************************************************************/
static int efm32_gpio_interrupt(uint32_t mask, void *context)
{
uint32_t pending;
uint32_t bit;
int irq;
/* Get the set of even/odd, pending, enabled interrupts */
pending = getreg32(EFM32_GPIO_IF) & getreg32(EFM32_GPIO_IEN) & mask;
putreg32(pending, EFM32_GPIO_IFC);
/* Then dispatch each interrupt */
for (bit = 1, irq = EFM32_IRQ_EXTI0; pending != 0; bit <<= 1, irq++)
{
if ((pending & bit) != 0)
{
/* Re-deliver the IRQ (recurses! We got here from irq_dispatch!) */
irq_dispatch(irq, context);
/* Remove this from the set of pending interrupts */
pending &= ~bit;
}
}
return OK;
}
/****************************************************************************
* Name: efm32_even_interrupt
*
* Description:
* Even GPIO interrupt handling logic
*
****************************************************************************/
static int efm32_even_interrupt(int irq, void *context, void *arg)
{
return efm32_gpio_interrupt(0x00005555, context);
}
/****************************************************************************
* Name: efm32_even_interrupt
*
* Description:
* Even GPIO interrupt handling logic
*
****************************************************************************/
static int efm32_odd_interrupt(int irq, void *context, void *arg)
{
return efm32_gpio_interrupt(0x0000aaaa, context);
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: efm32_gpioirqinitialize
*
* Description:
* Initialize logic to support a second level of interrupt decoding for PIO
* pins.
*
****************************************************************************/
void efm32_gpioirqinitialize(void)
{
/* Initialize GPIO interrupt registers, disabling GPIO interrupts at the
* source
*/
putreg32(0, EFM32_GPIO_EXTIRISE);
putreg32(0, EFM32_GPIO_EXTIFALL);
putreg32(0, EFM32_GPIO_IEN);
/* Attach the even and odd interrupt handlers */
DEBUGVERIFY(irq_attach(EFM32_IRQ_GPIO_EVEN, efm32_even_interrupt, NULL));
DEBUGVERIFY(irq_attach(EFM32_IRQ_GPIO_ODD, efm32_odd_interrupt, NULL));
/* Enable GPIO even and odd interrupts at the NVIC */
up_enable_irq(EFM32_IRQ_GPIO_ODD);
up_enable_irq(EFM32_IRQ_GPIO_EVEN);
}
/****************************************************************************
* Name: efm32_gpioirq
*
* Description:
* Configure an interrupt for the specified PIO pin.
*
****************************************************************************/
void efm32_gpioirq(gpio_pinset_t pinset)
{
irqstate_t flags;
unsigned int shift;
uintptr_t regaddr;
uint32_t regval;
uint32_t bit;
uint8_t port;
uint8_t pin;
/* Get basic pin configuration information */
port = efm32_getport(pinset);
pin = efm32_getpin(pinset);
bit = ((uint32_t)1 << pin);
/* Make sure that the pin interrupt is disabled */
flags = enter_critical_section();
regval = getreg32(EFM32_GPIO_IEN);
regval &= ~bit;
putreg32(regval, EFM32_GPIO_IEN);
/* Set the interrupt port */
if (pin < 8)
{
regaddr = EFM32_GPIO_EXTIPSELL;
shift = (unsigned int)pin << 2;
}
else
{
regaddr = EFM32_GPIO_EXTIPSELH;
shift = (unsigned int)(pin - 8) << 2;
}
regval = getreg32(regaddr);
regval &= ~(7 << shift);
regval |= ((uint32_t)port << shift);
putreg32(regval, regaddr);
/* Set/clear rising edge interrupt detection */
regval = getreg32(EFM32_GPIO_EXTIRISE);
if ((pinset & GPIO_INT_RISING) != 0)
{
regval |= bit;
}
else
{
regval &= ~bit;
}
putreg32(regval, EFM32_GPIO_EXTIRISE);
/* Set/clear rising edge interrupt detection */
regval = getreg32(EFM32_GPIO_EXTIFALL);
if ((pinset & GPIO_INT_FALLING) != 0)
{
regval |= bit;
}
else
{
regval &= ~bit;
}
putreg32(regval, EFM32_GPIO_EXTIFALL);
leave_critical_section(flags);
}
/****************************************************************************
* Name: efm32_gpioirqenable
*
* Description:
* Enable the interrupt for specified PIO IRQ
*
****************************************************************************/
void efm32_gpioirqenable(int irq)
{
if (irq >= EFM32_IRQ_EXTI0 && irq <= EFM32_IRQ_EXTI15)
{
/* Enable the interrupt associated with the pin */
#ifndef CONFIG_EFM32_BITBAND
irqstate_t flags;
uint32_t regval;
uint32_t bit;
bit = ((uint32_t)1 << (irq - EFM32_IRQ_EXTI0));
flags = enter_critical_section();
regval = getreg32(EFM32_GPIO_IEN);
regval |= bit;
putreg32(regval, EFM32_GPIO_IEN);
leave_critical_section(flags);
#else
bitband_set_peripheral(EFM32_GPIO_IEN, (irq - EFM32_IRQ_EXTI0), 1);
#endif
}
}
/****************************************************************************
* Name: efm32_gpioirqdisable
*
* Description:
* Disable the interrupt for specified PIO IRQ
*
****************************************************************************/
void efm32_gpioirqdisable(int irq)
{
if (irq >= EFM32_IRQ_EXTI0 && irq <= EFM32_IRQ_EXTI15)
{
/* Enable the interrupt associated with the pin */
#ifndef CONFIG_EFM32_BITBAND
irqstate_t flags;
uint32_t regval;
uint32_t bit;
bit = ((uint32_t)1 << (irq - EFM32_IRQ_EXTI0));
flags = enter_critical_section();
regval = getreg32(EFM32_GPIO_IEN);
regval &= ~bit;
putreg32(regval, EFM32_GPIO_IEN);
leave_critical_section(flags);
#else
bitband_set_peripheral(EFM32_GPIO_IEN, (irq - EFM32_IRQ_EXTI0), 0);
#endif
}
}
/****************************************************************************
* Name: efm32_gpioirqclear
*
* Description:
* Disable the interrupt for specified PIO IRQ
*
****************************************************************************/
void efm32_gpioirqclear(int irq)
{
if (irq >= EFM32_IRQ_EXTI0 && irq <= EFM32_IRQ_EXTI15)
{
/* Enable the interrupt associated with the pin */
#ifndef CONFIG_EFM32_BITBAND
irqstate_t flags;
uint32_t regval;
uint32_t bit;
bit = ((uint32_t)1 << (irq - EFM32_IRQ_EXTI0));
flags = enter_critical_section();
regval = getreg32(EFM32_GPIO_IFC);
regval |= bit;
putreg32(regval, EFM32_GPIO_IFC);
leave_critical_section(flags);
#else
bitband_set_peripheral(EFM32_GPIO_IFC, (irq - EFM32_IRQ_EXTI0), 1);
#endif
}
}
#endif /* CONFIG_EFM32_GPIO_IRQ */
|
b083b16b9b9c562ba2c260ce5fb20ad85ae28c78
|
e72db16e9747386afd01edd1dd36d9589a3f71ef
|
/src/libpmemobj/sync.h
|
46aa1bb221c57d751153d6975bf45e7d76a7dce6
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
pmem/pmdk
|
5e49feee8017574340db2a0f9b4e2eab99f8581c
|
ccadb16227bddea1bdcc518bd8f298d551b2baad
|
refs/heads/master
| 2023-08-31T02:28:06.884934
| 2023-08-30T14:52:25
| 2023-08-30T14:52:25
| 23,637,153
| 1,017
| 402
|
NOASSERTION
| 2023-09-07T11:52:42
| 2014-09-03T20:55:23
|
C
|
UTF-8
|
C
| false
| false
| 2,507
|
h
|
sync.h
|
/* SPDX-License-Identifier: BSD-3-Clause */
/* Copyright 2016-2020, Intel Corporation */
/*
* sync.h -- internal to obj synchronization API
*/
#ifndef LIBPMEMOBJ_SYNC_H
#define LIBPMEMOBJ_SYNC_H 1
#include <errno.h>
#include <stdint.h>
#include "libpmemobj.h"
#include "out.h"
#include "os_thread.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* internal definitions of PMEM-locks
*/
typedef union padded_pmemmutex {
char padding[_POBJ_CL_SIZE];
struct {
uint64_t runid;
union {
os_mutex_t mutex;
struct {
void *bsd_mutex_p;
union padded_pmemmutex *next;
} bsd_u;
} mutex_u;
} pmemmutex;
} PMEMmutex_internal;
#define PMEMmutex_lock pmemmutex.mutex_u.mutex
#define PMEMmutex_bsd_mutex_p pmemmutex.mutex_u.bsd_u.bsd_mutex_p
#define PMEMmutex_next pmemmutex.mutex_u.bsd_u.next
typedef union padded_pmemrwlock {
char padding[_POBJ_CL_SIZE];
struct {
uint64_t runid;
union {
os_rwlock_t rwlock;
struct {
void *bsd_rwlock_p;
union padded_pmemrwlock *next;
} bsd_u;
} rwlock_u;
} pmemrwlock;
} PMEMrwlock_internal;
#define PMEMrwlock_lock pmemrwlock.rwlock_u.rwlock
#define PMEMrwlock_bsd_rwlock_p pmemrwlock.rwlock_u.bsd_u.bsd_rwlock_p
#define PMEMrwlock_next pmemrwlock.rwlock_u.bsd_u.next
typedef union padded_pmemcond {
char padding[_POBJ_CL_SIZE];
struct {
uint64_t runid;
union {
os_cond_t cond;
struct {
void *bsd_cond_p;
union padded_pmemcond *next;
} bsd_u;
} cond_u;
} pmemcond;
} PMEMcond_internal;
#define PMEMcond_cond pmemcond.cond_u.cond
#define PMEMcond_bsd_cond_p pmemcond.cond_u.bsd_u.bsd_cond_p
#define PMEMcond_next pmemcond.cond_u.bsd_u.next
/*
* pmemobj_mutex_lock_nofail -- pmemobj_mutex_lock variant that never
* fails from caller perspective. If pmemobj_mutex_lock failed, this function
* aborts the program.
*/
static inline void
pmemobj_mutex_lock_nofail(PMEMobjpool *pop, PMEMmutex *mutexp)
{
int ret = pmemobj_mutex_lock(pop, mutexp);
if (ret) {
errno = ret;
FATAL("!pmemobj_mutex_lock");
}
}
/*
* pmemobj_mutex_unlock_nofail -- pmemobj_mutex_unlock variant that never
* fails from caller perspective. If pmemobj_mutex_unlock failed, this function
* aborts the program.
*/
static inline void
pmemobj_mutex_unlock_nofail(PMEMobjpool *pop, PMEMmutex *mutexp)
{
int ret = pmemobj_mutex_unlock(pop, mutexp);
if (ret) {
errno = ret;
FATAL("!pmemobj_mutex_unlock");
}
}
int pmemobj_mutex_assert_locked(PMEMobjpool *pop, PMEMmutex *mutexp);
#ifdef __cplusplus
}
#endif
#endif
|
d965acd9f5b48af60c164b6770317f0c56006f80
|
5f6ae188cab1dc9ae11086fa5e9785821d14ce93
|
/ctrlfnt.h
|
c95448522f044048b47492d4dc621f1182ef2c6e
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
phillbush/xnotify
|
6fded9ddee75c1a824dd7a04b901f72b310527ee
|
d9b155b92abe8c690353e51b6cfb926d788bd01b
|
refs/heads/master
| 2023-08-31T09:23:56.474037
| 2023-08-24T23:36:35
| 2023-08-24T23:36:35
| 296,789,657
| 165
| 21
|
MIT
| 2023-01-13T18:57:27
| 2020-09-19T04:59:13
|
C
|
UTF-8
|
C
| false
| false
| 603
|
h
|
ctrlfnt.h
|
typedef struct CtrlFontSet CtrlFontSet;
CtrlFontSet *
ctrlfnt_open(
Display *display,
int screen,
Visual *visual,
Colormap colormap,
const char *fontset_spec,
double fontsize
);
int
ctrlfnt_draw(
CtrlFontSet *fontset,
Picture picture,
Picture src,
XRectangle rect,
const char *text,
int nbytes
);
int ctrlfnt_width(CtrlFontSet *fontset, const char *text, int nbytes);
int ctrlfnt_height(CtrlFontSet *fontset);
void ctrlfnt_free(CtrlFontSet *fontset);
void ctrlfnt_init(void);
void ctrlfnt_term(void);
|
6fb90af7969841a5003b2803b3b4a4b87f24eb5e
|
6bac07ceda232029b6a9ea0144ad261311348699
|
/plugin_vc/game_vc/tFlyingHandlingData.h
|
5d9aa733483b7c73afb47f1386157f58e323a641
|
[
"Zlib"
] |
permissive
|
DK22Pac/plugin-sdk
|
ced6dc734846f33113e3596045b58febb7eb083c
|
b0ebc6e4f44c2d5f768b36c6a7a2a688e7e2b9d3
|
refs/heads/master
| 2023-08-17T06:36:25.363361
| 2023-08-10T05:19:16
| 2023-08-10T05:19:20
| 17,803,683
| 445
| 221
|
Zlib
| 2023-08-13T04:34:28
| 2014-03-16T16:40:08
|
C++
|
UTF-8
|
C
| false
| false
| 651
|
h
|
tFlyingHandlingData.h
|
/*
Plugin-SDK (Grand Theft Auto Vice City) header file
Authors: GTA Community. See more here
https://github.com/DK22Pac/plugin-sdk
Do not delete this comment block. Respect others' work!
*/
#pragma once
#include "PluginBase.h"
#include "CVector.h"
struct tFlyingHandlingData {
int m_dwVehicleId;
float fThrust;
float fThrustFallOff;
float fYaw;
float fYawStab;
float fSideSlip;
float fRoll;
float fRollStab;
float fPitch;
float fPitchStab;
float fFormLift;
float fAttackLift;
float fMoveRes;
CVector vecTurnRes;
CVector vecSpeedRes;
};
VALIDATE_SIZE(tFlyingHandlingData, 0x4C);
|
26915759348f04d27df200c7880651b46ad1fccd
|
56425322bf560653842a172b415c114a825ad4cd
|
/08_test_CXX/proc/proc_init.c
|
e0ff175be8a511e86a24dfb508f5a9779eeae85d
|
[
"MIT"
] |
permissive
|
allexoll/BBB-BareMetal
|
2d4b379ef3f174ca9587532e9daa5eafca58f172
|
4dce20eef8f6d6b2e04de149588df446c0e7fcc7
|
refs/heads/master
| 2023-06-22T06:44:37.096603
| 2023-06-07T10:11:36
| 2023-06-07T10:11:36
| 27,220,290
| 111
| 49
|
MIT
| 2023-06-07T10:11:38
| 2014-11-27T10:26:05
|
C
|
UTF-8
|
C
| false
| false
| 1,032
|
c
|
proc_init.c
|
/**
* @file proc_init.c
* @author Alexis Marquet
* @date 28 Apr 2015
* @brief Initialize the processor and its needed peripherals
**/
#include "../core/llma.h"
#include "UART.h"
#include <stdio.h>
#define NVIC 0x48200000
#define CM_WKUP 0x44E00400
void procInit()
{
/* peripherals */
PUT32(0x47400000+0x10,1); // reset USB controller to get the internet connection back
PUT32(NVIC+0x10,1); // reset INTC controller
while((GET32(NVIC+0x14)&0x1)==0); // wait until reset is done
PUT32(NVIC+0x68,0xFF); // disable interrupt threshold
PUT32(NVIC+0x50,1); // enable functional clock
PUT32(NVIC+0x94,0xFFFFFFFF); // clear INTC_ISR_CLEAR0
PUT32(NVIC+0xB4,0xFFFFFFFF); // clear INTC_ISR_CLEAR0
PUT32(NVIC+0xD4,0xFFFFFFFF); // clear INTC_ISR_CLEAR0
PUT32(NVIC+0xF4,0xFFFFFFFF); // clear INTC_ISR_CLEAR0
CPU_irqE();
UART_initUART(UART0,115200,STOP1,PARITY_NONE,FLOW_OFF);
UART_putString(UART0,"$UART0 Initialized... compiled at " __TIME__ "\n",43);
}
|
168239f621d3919d5192398bd53ec96e550f58bc
|
a3d6556180e74af7b555f8d47d3fea55b94bcbda
|
/third_party/khronos/GLES2/gl2ext.h
|
3472b000661dac16e217b83dd8de70604f5e3e08
|
[
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-other-permissive",
"MIT",
"SGI-B-2.0",
"LicenseRef-scancode-khronos",
"BSD-3-Clause",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"Apache-2.0"
] |
permissive
|
chromium/chromium
|
aaa9eda10115b50b0616d2f1aed5ef35d1d779d6
|
a401d6cf4f7bf0e2d2e964c512ebb923c3d8832c
|
refs/heads/main
| 2023-08-24T00:35:12.585945
| 2023-08-23T22:01:11
| 2023-08-23T22:01:11
| 120,360,765
| 17,408
| 7,102
|
BSD-3-Clause
| 2023-09-10T23:44:27
| 2018-02-05T20:55:32
| null |
UTF-8
|
C
| false
| false
| 246,785
|
h
|
gl2ext.h
|
#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 20190911 */
/* 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);
/* Chromium-specific commented out GL_SAMPLER. */
//#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);
// Chromium-specific define to account for issues in gles2_conform_test
// TODO (bajones): This symbol should be updated to the correct version in the
// conformance test upstream and this hack removed. crbug.com/329708
#define PFNGLFRAMEBUFFERTEXTURE3DOES PFNGLFRAMEBUFFERTEXTURE3DOESPROC
#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
|
bdfa9f14323ec69f88446c1cc268473448c73ad8
|
0744dcc5394cebf57ebcba343747af6871b67017
|
/os/board/rtl8730e/src/component/soc/amebad2/atf/lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
|
b69c6702ba9d10c6601db0d4f776496b7b7afac2
|
[
"Apache-2.0",
"GPL-1.0-or-later",
"BSD-3-Clause",
"ISC",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive"
] |
permissive
|
Samsung/TizenRT
|
96abf62f1853f61fcf91ff14671a5e0c6ca48fdb
|
1a5c2e00a4b1bbf4c505bbf5cc6a8259e926f686
|
refs/heads/master
| 2023-08-31T08:59:33.327998
| 2023-08-08T06:09:20
| 2023-08-31T04:38:20
| 82,517,252
| 590
| 719
|
Apache-2.0
| 2023-09-14T06:54:49
| 2017-02-20T04:38:30
|
C
|
UTF-8
|
C
| false
| false
| 6,613
|
c
|
xlat_tables_arch.c
|
/*
* Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <stdbool.h>
#include <platform_def.h>
#include <arch.h>
#include <arch_features.h>
#include <arch_helpers.h>
#include <lib/cassert.h>
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include "../xlat_tables_private.h"
#if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING)
#error ARMv7 target does not support LPAE MMU descriptors
#endif
/*
* Returns true if the provided granule size is supported, false otherwise.
*/
bool xlat_arch_is_granule_size_supported(size_t size)
{
/*
* The library uses the long descriptor translation table format, which
* supports 4 KiB pages only.
*/
return size == PAGE_SIZE_4KB;
}
size_t xlat_arch_get_max_supported_granule_size(void)
{
return PAGE_SIZE_4KB;
}
#if ENABLE_ASSERTIONS
unsigned long long xlat_arch_get_max_supported_pa(void)
{
/* Physical address space size for long descriptor format. */
return (1ULL << 40) - 1ULL;
}
/*
* Return minimum virtual address space size supported by the architecture
*/
uintptr_t xlat_get_min_virt_addr_space_size(void)
{
return MIN_VIRT_ADDR_SPACE_SIZE;
}
#endif /* ENABLE_ASSERTIONS*/
bool is_mmu_enabled_ctx(const xlat_ctx_t *ctx)
{
if (ctx->xlat_regime == EL1_EL0_REGIME) {
assert(xlat_arch_current_el() == 1U);
return (read_sctlr() & SCTLR_M_BIT) != 0U;
} else {
assert(ctx->xlat_regime == EL2_REGIME);
assert(xlat_arch_current_el() == 2U);
return (read_hsctlr() & HSCTLR_M_BIT) != 0U;
}
}
bool is_dcache_enabled(void)
{
if (IS_IN_EL2()) {
return (read_hsctlr() & HSCTLR_C_BIT) != 0U;
} else {
return (read_sctlr() & SCTLR_C_BIT) != 0U;
}
}
uint64_t xlat_arch_regime_get_xn_desc(int xlat_regime)
{
if (xlat_regime == EL1_EL0_REGIME) {
return UPPER_ATTRS(XN) | UPPER_ATTRS(PXN);
} else {
assert(xlat_regime == EL2_REGIME);
return UPPER_ATTRS(XN);
}
}
void xlat_arch_tlbi_va(uintptr_t va, int xlat_regime)
{
/*
* Ensure the translation table write has drained into memory before
* invalidating the TLB entry.
*/
dsbishst();
if (xlat_regime == EL1_EL0_REGIME) {
tlbimvaais(TLBI_ADDR(va));
} else {
assert(xlat_regime == EL2_REGIME);
tlbimvahis(TLBI_ADDR(va));
}
}
void xlat_arch_tlbi_va_sync(void)
{
/* Invalidate all entries from branch predictors. */
bpiallis();
/*
* A TLB maintenance instruction can complete at any time after
* it is issued, but is only guaranteed to be complete after the
* execution of DSB by the PE that executed the TLB maintenance
* instruction. After the TLB invalidate instruction is
* complete, no new memory accesses using the invalidated TLB
* entries will be observed by any observer of the system
* domain. See section D4.8.2 of the ARMv8 (issue k), paragraph
* "Ordering and completion of TLB maintenance instructions".
*/
dsbish();
/*
* The effects of a completed TLB maintenance instruction are
* only guaranteed to be visible on the PE that executed the
* instruction after the execution of an ISB instruction by the
* PE that executed the TLB maintenance instruction.
*/
isb();
}
unsigned int xlat_arch_current_el(void)
{
if (IS_IN_HYP()) {
return 2U;
} else {
assert(IS_IN_SVC() || IS_IN_MON());
/*
* If EL3 is in AArch32 mode, all secure PL1 modes (Monitor,
* System, SVC, Abort, UND, IRQ and FIQ modes) execute at EL3.
*
* The PL1&0 translation regime in AArch32 behaves like the
* EL1&0 regime in AArch64 except for the XN bits, but we set
* and unset them at the same time, so there's no difference in
* practice.
*/
return 1U;
}
}
/*******************************************************************************
* Function for enabling the MMU in PL1 or PL2, assuming that the page tables
* have already been created.
******************************************************************************/
void setup_mmu_cfg(uint64_t *params, unsigned int flags,
const uint64_t *base_table, unsigned long long max_pa,
uintptr_t max_va, __unused int xlat_regime)
{
uint64_t mair, ttbr0;
uint32_t ttbcr;
/* Set attributes in the right indices of the MAIR */
mair = MAIR0_ATTR_SET(ATTR_DEVICE, ATTR_DEVICE_INDEX);
mair |= MAIR0_ATTR_SET(ATTR_IWBWA_OWBWA_NTR,
ATTR_IWBWA_OWBWA_NTR_INDEX);
mair |= MAIR0_ATTR_SET(ATTR_NON_CACHEABLE,
ATTR_NON_CACHEABLE_INDEX);
/*
* Configure the control register for stage 1 of the PL1&0 or EL2
* translation regimes.
*/
/* Use the Long-descriptor translation table format. */
ttbcr = TTBCR_EAE_BIT;
if (xlat_regime == EL1_EL0_REGIME) {
assert(IS_IN_SVC() || IS_IN_MON());
/*
* Disable translation table walk for addresses that are
* translated using TTBR1. Therefore, only TTBR0 is used.
*/
ttbcr |= TTBCR_EPD1_BIT;
} else {
assert(xlat_regime == EL2_REGIME);
assert(IS_IN_HYP());
/*
* Set HTCR bits as well. Set HTTBR table properties
* as Inner & outer WBWA & shareable.
*/
ttbcr |= HTCR_RES1 |
HTCR_SH0_INNER_SHAREABLE | HTCR_RGN0_OUTER_WBA |
HTCR_RGN0_INNER_WBA;
}
/*
* Limit the input address ranges and memory region sizes translated
* using TTBR0 to the given virtual address space size, if smaller than
* 32 bits.
*/
if (max_va != UINT32_MAX) {
uintptr_t virtual_addr_space_size = max_va + 1U;
assert(virtual_addr_space_size >=
xlat_get_min_virt_addr_space_size());
assert(virtual_addr_space_size <=
MAX_VIRT_ADDR_SPACE_SIZE);
assert(IS_POWER_OF_TWO(virtual_addr_space_size));
/*
* __builtin_ctzll(0) is undefined but here we are guaranteed
* that virtual_addr_space_size is in the range [1, UINT32_MAX].
*/
int t0sz = 32 - __builtin_ctzll(virtual_addr_space_size);
ttbcr |= (uint32_t) t0sz;
}
/*
* Set the cacheability and shareability attributes for memory
* associated with translation table walks using TTBR0.
*/
if ((flags & XLAT_TABLE_NC) != 0U) {
/* Inner & outer non-cacheable non-shareable. */
ttbcr |= TTBCR_SH0_NON_SHAREABLE | TTBCR_RGN0_OUTER_NC |
TTBCR_RGN0_INNER_NC;
} else {
/* Inner & outer WBWA & shareable. */
ttbcr |= TTBCR_SH0_INNER_SHAREABLE | TTBCR_RGN0_OUTER_WBA |
TTBCR_RGN0_INNER_WBA;
}
/* Set TTBR0 bits as well */
ttbr0 = (uint64_t)(uintptr_t) base_table;
if (is_armv8_2_ttcnp_present()) {
/* Enable CnP bit so as to share page tables with all PEs. */
ttbr0 |= TTBR_CNP_BIT;
}
/* Now populate MMU configuration */
params[MMU_CFG_MAIR] = mair;
params[MMU_CFG_TCR] = (uint64_t) ttbcr;
params[MMU_CFG_TTBR0] = ttbr0;
}
|
47ac2ca9c241472088771d43e7add76e4ae1e19d
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/arch/arm/src/sam34/hardware/sam_rswdt.h
|
644bb185f019c88d8f2d6062fd74e0104dcac720
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 4,292
|
h
|
sam_rswdt.h
|
/****************************************************************************
* arch/arm/src/sam34/hardware/sam_rswdt.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/
#ifndef __ARCH_ARM_SRC_SAM34_HARDWARE_SAM_RSWDT_H
#define __ARCH_ARM_SRC_SAM34_HARDWARE_SAM_RSWDT_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include "chip.h"
#include "hardware/sam_memorymap.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* RSWDT register offsets ***************************************************/
#define SAM_RSWDT_CR_OFFSET 0x0000 /* Control Register */
#define SAM_RSWDT_MR_OFFSET 0x0004 /* Mode Register */
#define SAM_RSWDT_SR_OFFSET 0x0008 /* Status Register */
/* RSWDT register addresses *************************************************/
#define SAM_RSWDT_CR (SAM_RSWDT_BASE+SAM_RSWDT_CR_OFFSET)
#define SAM_RSWDT_MR (SAM_RSWDT_BASE+SAM_RSWDT_MR_OFFSET)
#define SAM_RSWDT_SR (SAM_RSWDT_BASE+SAM_RSWDT_SR_OFFSET)
/* RSWDT register bit definitions *******************************************/
/* Watchdog Timer Control Register */
#define RSWDT_CR_WDRSTT (1 << 0) /* Bit 0: Watchdog Rest */
#define RSWDT_CR_KEY_SHIFT (24) /* Bits 24-31: Password */
#define RSWDT_CR_KEY_MASK (0xff << RSWDT_CR_KEY_SHIFT)
# define RSWDT_CR_KEY (0xc4 << RSWDT_CR_KEY_SHIFT)
/* Watchdog Timer Mode Register */
#define RSWDT_MR_WDV_SHIFT (0) /* Bits 0-11: Watchdog Counter Value */
#define RSWDT_MR_WDV_MASK (0xfff << RSWDT_MR_WDV_SHIFT)
# define RSWDT_MR_WDV(n) ((uint32_t)(n) << RSWDT_MR_WDV_SHIFT)
#define RSWDT_MR_WDFIEN (1 << 12) /* Bit 12: Watchdog Fault Interrupt Enable */
#define RSWDT_MR_WDRSTEN (1 << 13) /* Bit 13: Watchdog Reset Enable */
#define RSWDT_MR_WDRPROC (1 << 14) /* Bit 14: Watchdog Reset Processor */
#define RSWDT_MR_WDDIS (1 << 15) /* Bit 15: Watchdog Disable */
#define RSWDT_MR_WDD_SHIFT (16) /* Bits 16-27: Watchdog Delta Value */
#define RSWDT_MR_WDD_MASK (0xfff << RSWDT_MR_WDD_SHIFT)
# define RSWDT_MR_WDD(n) ((uint32_t)(n) << RSWDT_MR_WDD_SHIFT)
#define RSWDT_MR_WDDBGHLT (1 << 28) /* Bit 28: Watchdog Debug Halt */
#define RSWDT_MR_WDIDLEHLT (1 << 29) /* Bit 29: Watchdog Idle Halt */
/* Watchdog Timer Status Register */
#define RSWDT_SR_WDUNF (1 << 0) /* Bit 0: Watchdog Underflow */
#define RSWDT_SR_WDERR (1 << 1) /* Bit 1: Watchdog Error */
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
#endif /* __ARCH_ARM_SRC_SAM34_HARDWARE_SAM_RSWDT_H */
|
cb573c657c13aa3349a582d22dcf59f659300fb1
|
3bd385b466cb035fecd2b0c11ae054d42bf44fc2
|
/src/extended/linearalign.h
|
d7c20dd43604f26691381b1da23acd36a8437e5d
|
[
"LicenseRef-scancode-unknown-license-reference",
"ISC",
"BSD-2-Clause",
"LicenseRef-scancode-mit-old-style",
"Zlib",
"MIT",
"BSD-3-Clause",
"bzip2-1.0.6"
] |
permissive
|
genometools/genometools
|
c366dff04f6baa887f6b3be3ec55bce824b2bae1
|
df1df94b8c05a9c9bf848ffc6755c87b58573da5
|
refs/heads/master
| 2023-04-13T13:57:18.748796
| 2023-04-09T21:29:53
| 2023-04-09T21:29:53
| 11,177,980
| 237
| 63
|
NOASSERTION
| 2023-04-09T21:29:54
| 2013-07-04T13:39:38
|
C
|
UTF-8
|
C
| false
| false
| 5,874
|
h
|
linearalign.h
|
/*
Copyright (c) 2015 Annika Seidel <annika.seidel@studium.uni-hamburg.de>
Copyright (C) 2015 Joerg Winkler <j.winkler@posteo.de>
Copyright (c) 2006-2007 Gordon Gremme <gordon@gremme.org>
Copyright (c) 2006-2015 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, 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.
*/
#ifndef LINEARALIGN_H
#define LINEARALIGN_H
#include "core/unused_api.h"
#include "core/error_api.h"
#include "extended/linspace_management.h"
#include "extended/scorehandler.h"
/* Computes a global alignment with linear gapcosts in linear space. Use of this
function requires an initialised <spacemanager>, the target alignment <align>
and input sequences <useq> and <vseq>, with the regions to align given by
their start positions <ustart> and <vstart> and lengths <ulen> and <vlen>.
The cost values are specified by an initialised <scorehandler>. Returns
distance value of calculated global alignment. */
GtUword gt_linearalign_compute_generic(GtLinspaceManagement *spacemanager,
const GtScoreHandler *scorehandler,
GtAlignment *align,
const GtUchar *useq,
GtUword ustart,
GtUword ulen,
const GtUchar *vseq,
GtUword vstart,
GtUword vlen);
/* Computes a global alignment with linear gapcosts in linear space
and constant cost values. Use of this function requires an initialised
<spacemanager>, the target alignment <align> and input sequences <useq> and
<vseq>, with the regions to align given by their start positions <ustart> and
<vstart> and lengths <ulen> and <vlen>. The cost values are specified by
<matchcost>, <mismatchcost> and <gapcost>. Returns distance value of
calculated global alignment. */
GtUword gt_linearalign_compute(GtLinspaceManagement *spacemanager,
GtAlignment *align,
const GtUchar *useq,
GtUword ustart,
GtUword ulen,
const GtUchar *vseq,
GtUword vstart,
GtUword vlen,
GtUword matchcost,
GtUword mismatchcost,
GtUword gapcost);
/* Computes a local alignment with linear gapcosts in linear space. Use of this
function requires an initialised <spacemanager>, the target alignment <align>
and input sequences <useq> and <vseq>, with the regions to align given by
their start positions <ustart> and <vstart> and lengths <ulen> and <vlen>.
The score values are specified by an initialised <scorehandler>. Returns
score value of calculated local alignment. */
GtWord gt_linearalign_compute_local_generic(GtLinspaceManagement *spacemanager,
const GtScoreHandler *scorehandler,
GtAlignment *align,
const GtUchar *useq,
GtUword ustart,
GtUword ulen,
const GtUchar *vseq,
GtUword vstart,
GtUword vlen);
/* Computes a local alignment with linear gapcosts in linear space
and constant score values. Use of this function requires an initialised
<spacemanager>, the target alignment <align> and input sequences <useq> and
<vseq>, with the regions to align given by their start positions <ustart> and
<vstart> and lengths <ulen> and <vlen>. The score values are specified by
<matchscore>, <mismatchscore> and <gapscore>. Returns score value of
calculated local alignment. */
GtWord gt_linearalign_compute_local(GtLinspaceManagement *spacemanager,
GtAlignment *align,
const GtUchar *useq,
GtUword ustart,
GtUword ulen,
const GtUchar *vseq,
GtUword vstart,
GtUword vlen,
GtWord matchscore,
GtWord mismatchscore,
GtWord gapscore);
void gt_linearalign_check(GT_UNUSED bool forward,
const GtUchar *useq,
GtUword ulen,
const GtUchar *vseq,
GtUword vlen);
void gt_linearalign_check_local(GT_UNUSED bool forward,
const GtUchar *useq,
GtUword ulen,
const GtUchar *vseq,
GtUword vlen);
#endif
|
9f9a40c5acaca103bdf56727475da0224e4bb52b
|
6d54a7b26d0eb82152a549a6a9dfde656687752c
|
/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.h
|
a2c59596d9e9e5c5f659ef757757f70a0c10b12c
|
[
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
project-chip/connectedhomeip
|
81a123d675cf527773f70047d1ed1c43be5ffe6d
|
ea3970a7f11cd227ac55917edaa835a2a9bc4fc8
|
refs/heads/master
| 2023-09-01T11:43:37.546040
| 2023-09-01T08:01:32
| 2023-09-01T08:01:32
| 244,694,174
| 6,409
| 1,789
|
Apache-2.0
| 2023-09-14T20:56:31
| 2020-03-03T17:05:10
|
C++
|
UTF-8
|
C
| false
| false
| 1,573
|
h
|
ConversionUtils.h
|
/*
*
* Copyright (c) 2021 Project CHIP Authors
*
* 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.
*/
#pragma once
#include "AppParams.h"
#include "TargetEndpointInfo.h"
#include "TargetVideoPlayerInfo.h"
#include <lib/dnssd/Resolver.h>
CHIP_ERROR convertJAppParametersToCppAppParams(jobject appParameters, AppParams & outAppParams);
CHIP_ERROR convertJContentAppToTargetEndpointInfo(jobject contentApp, TargetEndpointInfo & outTargetEndpointInfo);
CHIP_ERROR convertTargetEndpointInfoToJContentApp(TargetEndpointInfo * targetEndpointInfo, jobject & outContentApp);
CHIP_ERROR convertJVideoPlayerToTargetVideoPlayerInfo(jobject videoPlayer, TargetVideoPlayerInfo & targetVideoPlayerInfo);
CHIP_ERROR convertTargetVideoPlayerInfoToJVideoPlayer(TargetVideoPlayerInfo * targetVideoPlayerInfo, jobject & outVideoPlayer);
CHIP_ERROR convertJDiscoveredNodeDataToCppDiscoveredNodeData(jobject jDiscoveredNodeData,
chip::Dnssd::DiscoveredNodeData & cppDiscoveredNodeData);
|
8314f202a83a273e9dfe738d130d5d7560f38fa8
|
3c6e1e35f38421273f92dd25055dccc6f632fd93
|
/app/sjson/memcompat.h
|
d6fba37b22127d7076e95c0de831f0ec15bf4c07
|
[
"MIT"
] |
permissive
|
nodemcu/nodemcu-firmware
|
fd907ddf01bf17fdc55dd352d6987ee91d8b95e3
|
f25dc56d3c6213b8ac7ce46d1293466137746eae
|
refs/heads/release
| 2023-08-22T21:46:10.995686
| 2021-12-30T07:46:20
| 2021-12-30T07:46:20
| 26,917,568
| 8,077
| 3,888
|
MIT
| 2023-07-25T09:20:45
| 2014-11-20T15:06:45
|
C
|
UTF-8
|
C
| false
| false
| 94
|
h
|
memcompat.h
|
#ifndef __MEMCOMPAT_H__
#define __MEMCOMPAT_H__
#include <stdint.h>
#include "mem.h"
#endif
|
48ecfded0b22974c86f382dcfd68029c676040b3
|
cff4428975e403e4ef02d75498b78cd1a610a01a
|
/test/unit/trigger.c
|
cbe994526e7a204bf4ff14417a84122ecaf45ce8
|
[
"BSD-2-Clause"
] |
permissive
|
tarantool/tarantool
|
c1f252b642d223af62485dc21165c7f7c3354e7e
|
f58cc96f2798ddc5f492223897d0b77e4f902128
|
refs/heads/master
| 2023-09-03T15:16:29.144171
| 2023-08-31T11:39:28
| 2023-09-01T12:39:29
| 911,980
| 3,205
| 490
|
NOASSERTION
| 2023-09-14T17:58:17
| 2010-09-15T07:59:26
|
Lua
|
UTF-8
|
C
| false
| false
| 4,482
|
c
|
trigger.c
|
#define UNIT_TAP_COMPATIBLE 1
#include "unit.h"
#include <stdbool.h>
#include <assert.h>
#include "memory.h"
#include "fiber.h"
#include "trigger.h"
/* Length of trigger chains to test. */
#define TEST_LENGTH 5
#define FUNC_COUNT (TEST_LENGTH + 3)
struct test_trigger {
struct trigger base;
int id;
int target_id;
};
/* How many times each trigger was run. */
static int was_run[TEST_LENGTH];
/* Function codes for each trigger. */
static int funcs[TEST_LENGTH];
static struct test_trigger triggers[TEST_LENGTH];
static RLIST_HEAD(list_a);
static RLIST_HEAD(list_b);
static int
trigger_nop_f(struct trigger *trigger, void *event)
{
struct test_trigger *trig = (struct test_trigger *)trigger;
was_run[trig->id]++;
return 0;
}
static int
trigger_err_f(struct trigger *trigger, void *event)
{
trigger_nop_f(trigger, event);
return -1;
}
static int
trigger_swap_f(struct trigger *trigger, void *event)
{
trigger_nop_f(trigger, event);
rlist_swap(&list_a, &list_b);
return 0;
}
static int
trigger_clear_f(struct trigger *trigger, void *event)
{
trigger_nop_f(trigger, event);
struct test_trigger *trig = (struct test_trigger *)trigger;
int clear_id = trig->target_id;
trigger_clear(&triggers[clear_id].base);
return 0;
}
/**
* Types of trigger functions which might harm trigger_run one way or another.
*/
enum func_type {
/** Do nothing. */
FUNC_TYPE_NOP,
/** Error. */
FUNC_TYPE_ERR,
/** Swap trigger list heads. */
FUNC_TYPE_SWAP,
/** Clear one of the triggers: self or other. */
FUNC_TYPE_CLEAR,
};
static int
func_type_by_no(int func_no)
{
assert(func_no >= 0 && func_no < FUNC_COUNT);
if (func_no < TEST_LENGTH)
return FUNC_TYPE_CLEAR;
else if (func_no == TEST_LENGTH)
return FUNC_TYPE_ERR;
else if (func_no == TEST_LENGTH + 1)
return FUNC_TYPE_NOP;
else /* if (func_no == TEST_LENGTH + 2) */
return FUNC_TYPE_SWAP;
}
static void
fill_trigger_list(struct rlist *list, bool *should_run, int direction)
{
for (int i = 0; i < TEST_LENGTH; i++)
should_run[i] = true;
rlist_create(list);
/*
* Create triggers and deduce which should and which shouldn't run based
* on trigger functions and run direction.
*/
for (int i = (TEST_LENGTH - 1) * (1 - direction) / 2;
i >= 0 && i < TEST_LENGTH; i += direction) {
was_run[i] = 0;
triggers[i].id = i;
int func_no = funcs[i];
switch (func_type_by_no(func_no)) {
case FUNC_TYPE_CLEAR:
trigger_create(&triggers[i].base,
trigger_clear_f, NULL, NULL);
triggers[i].target_id = func_no;
if (!should_run[i])
break;
int target_id = funcs[i];
if (direction * i < direction * target_id)
should_run[target_id] = false;
break;
case FUNC_TYPE_ERR:
trigger_create(&triggers[i].base, trigger_err_f,
NULL, NULL);
if (!should_run[i])
break;
for (int j = i + direction; j >= 0 && j < TEST_LENGTH;
j += direction) {
should_run[j] = false;
}
break;
case FUNC_TYPE_NOP:
trigger_create(&triggers[i].base, trigger_nop_f,
NULL, NULL);
break;
case FUNC_TYPE_SWAP:
trigger_create(&triggers[i].base,
trigger_swap_f, NULL, NULL);
break;
}
}
/*
* Add triggers in reverse order, so that trigger[0] is first to run in
* direct order and last to run in reverse order.
*/
for (int i = TEST_LENGTH - 1; i >= 0; i--)
trigger_add(list, &triggers[i].base);
}
static void
test_trigger_one(void)
{
plan(2 * TEST_LENGTH);
for (int direction = -1; direction <= 1; direction += 2) {
bool should_run[TEST_LENGTH];
fill_trigger_list(&list_a, should_run, direction);
if (direction == 1)
trigger_run(&list_a, NULL);
else
trigger_run_reverse(&list_a, NULL);
for (int i = 0; i < TEST_LENGTH; i++) {
ok((should_run[i] && was_run[i] == 1) ||
(!should_run[i] && was_run[i] == 0),
"Triggers ran correctly");
}
}
check_plan();
}
static void
test_trigger(int pos, bool had_clear)
{
if (pos == TEST_LENGTH)
return test_trigger_one();
int i = had_clear ? TEST_LENGTH : 0;
plan(FUNC_COUNT - i);
for (i; i < FUNC_COUNT; i++) {
funcs[pos] = i;
test_trigger(pos + 1, had_clear || func_type_by_no(i) ==
FUNC_TYPE_CLEAR);
}
check_plan();
}
static int
test_trigger_clear_during_run(void)
{
header();
plan(1);
test_trigger(0, false);
footer();
return check_plan();
}
int
main(void)
{
memory_init();
fiber_init(fiber_c_invoke);
plan(1);
test_trigger_clear_during_run();
fiber_free();
memory_free();
return check_plan();
}
|
cde866210604927de88aa7f7c19b4eba76baaee1
|
cf60f9591fef521d3092f81785de7942d0ca568e
|
/PubNub/include/PNRequest+Private.h
|
7c82dcd1eef121d3739d6206131072c3c4c1ff05
|
[
"MIT"
] |
permissive
|
pubnub/objective-c
|
a49e2e5c7898eb893b601ae31a098361fb8b4406
|
eef06ae76fd45931ea09900e3b3ce50133870eca
|
refs/heads/master
| 2023-04-07T08:28:47.174178
| 2023-01-05T11:15:57
| 2023-01-05T11:15:57
| 8,490,984
| 137
| 145
|
NOASSERTION
| 2023-03-30T08:47:36
| 2013-03-01T00:10:41
|
Objective-C
|
UTF-8
|
C
| false
| false
| 39
|
h
|
PNRequest+Private.h
|
../Network/Requests/PNRequest+Private.h
|
cea513f862c021b5e2485946d52e1226918a81ae
|
1b676a5aae03dc79c1d3ed4c5038ceb08ea7e8f6
|
/old/keysound.c
|
a38c7085d48c4f7a865fa24ce8968bdd5fa5a865
|
[
"MIT"
] |
permissive
|
fgheng/keysound
|
8421b5b5efb92dd8fe2ace513d99024fb6866ae1
|
ac5fd67996d5ebbcd9b746300af5c7629965260d
|
refs/heads/master
| 2023-04-14T15:51:44.191510
| 2023-04-04T15:09:09
| 2023-04-04T15:09:09
| 235,383,952
| 112
| 18
|
MIT
| 2023-04-04T15:09:10
| 2020-01-21T16:08:08
|
C++
|
UTF-8
|
C
| false
| false
| 4,144
|
c
|
keysound.c
|
#include <SDL2/SDL.h>
#include <SDL2/SDL_audio.h>
#include <SDL2/SDL_stdinc.h>
#include <ctype.h>
#include <fcntl.h>
#include <linux/input.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
static const char *file_keyany = "./sources/keyany.wav";
static char name[64];
// 音频结构, 任意
static struct {
SDL_AudioSpec spec;
Uint8 *sound; // 存储音频地址
Uint32 soundlen; // 音频大小
int soundpos; // 播放到的位置
} wave_keyany;
// sdl 退出
static void quit(int rc) {
SDL_Quit();
exit(rc);
}
// 回调
// unused: 未使用
// stream: 音频流,
// len: stream的大小
// 将内容复制到stream中,sdl会播放stream中的内容
static void SDLCALL fillerup(void *unused, Uint8 *stream, int len) {
Uint8 *waveptr;
int waveleft;
// 定位到播放到的位置
waveptr = wave_keyany.sound + wave_keyany.soundpos;
// 剩余未播放的音频长度
waveleft = wave_keyany.soundlen - wave_keyany.soundpos;
// 复制len大小的内容进入stream
// 如果剩余的音频长度小于len
// 那么从头读取,填满
if (waveleft <= len) {
// 如果剩余的音频长度小于len
// 将剩余的内容复制到stream
SDL_memcpy(stream, waveptr, waveleft);
// 然后soundpos归0
wave_keyany.soundpos = 0;
waveptr = wave_keyany.sound + wave_keyany.soundpos;
SDL_memcpy(stream, waveptr, len - waveleft);
SDL_PauseAudio(1);
} else {
// 向后读取
SDL_memcpy(stream, waveptr, len);
wave_keyany.soundpos += len;
}
}
// 初始化音频
void init_audio() {
// 初始化sdl
// SDL_INIT_AUDIO 初始化音频子系统
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL 初始化失败: %s\n",
SDL_GetError());
return;
}
// 载入音频文件
if (SDL_LoadWAV(file_keyany, &wave_keyany.spec, &wave_keyany.sound,
&wave_keyany.soundlen) == NULL) {
quit(1);
}
//设置回调函数
wave_keyany.spec.callback = fillerup;
// 打开音频设备
if (SDL_OpenAudio(&wave_keyany.spec, NULL) < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "音频设备打开失败: %s\n",
SDL_GetError());
SDL_FreeWAV(wave_keyany.sound);
quit(2);
}
}
void finish_audio() {
SDL_CloseAudio(); //关掉音频进程以及音频设备
SDL_FreeWAV(wave_keyany.sound); //释放数据由SDL_LoadWAV申请的
SDL_Quit();
}
// 读取键盘输入
void detect_press(char *path) {
int fd;
char ret[2];
struct input_event ie;
// 读取文件
if ((fd = open((char *)path, O_RDONLY)) > 0) {
// 读取成功
while (1) {
// 按照input_event读取文件
if (read(fd, &ie, sizeof(struct input_event)) ==
sizeof(struct input_event)) {
if (ie.type == EV_KEY) {
if (ie.value == 1) {
// 按下, 播放按键声音
SDL_PauseAudio(0);
}
}
}
}
close(fd);
} else {
return;
}
}
static void str_to_lower(char *str, int len) {
for (int i = 0; i < len; i++) {
str[i] = tolower(str[i]);
}
}
// 获取键盘文件
// 即/dev/input/event**, **表示数字
void get_event_device() {
char buf[256] = {
0,
};
int fd = 0;
for (int i = 0; i < 64; i++) {
sprintf(name, "/dev/input/event%d", i);
// 打开input文件
if ((fd = open(name, O_RDONLY, 0)) >= 0) {
// 获取设备name的名称,存储到buf中
ioctl(fd, EVIOCGNAME(sizeof(buf)), buf);
str_to_lower(buf, strlen(buf));
if (strstr(buf, "keyboard")) {
printf("[%d]: %s\n", i, buf);
}
printf("");
}
}
close(fd);
}
int main(int argc, char *argv[]) {
int i;
printf("please input device number: \n");
get_event_device();
scanf("%d", &i);
printf("your number is %d\n", i);
sprintf(name, "/dev/input/event%d", i);
if (fork() > 0) {
// 父进程退出
exit(0);
}
// 初始化音频设备等
init_audio();
// 监控键盘
detect_press(name);
finish_audio();
}
|
d71551a748ad4d6b707e618770c6fa22b5ede4f3
|
56d1226dfefc93768a5f60ce15d1d7ca9bd58a08
|
/ddraw/IDirect3DTypes.h
|
38b709ee51bd124c86aadd7d281bebd4b6918d93
|
[
"Zlib",
"GPL-1.0-or-later"
] |
permissive
|
elishacloud/dxwrapper
|
ef6e047a6c49b98b74bf0adcff80740e8c0fff42
|
258bc970a72c7a4bd89449527a537e6912acbfb3
|
refs/heads/master
| 2023-08-17T06:13:06.649077
| 2023-08-16T21:17:18
| 2023-08-16T21:17:18
| 81,271,358
| 968
| 83
|
Zlib
| 2023-08-22T19:56:05
| 2017-02-08T00:58:26
|
C
|
UTF-8
|
C
| false
| false
| 2,304
|
h
|
IDirect3DTypes.h
|
#pragma once
#define D3DDP_FORCE_DWORD 0x0000001Fl
#define D3DDP_DXW_COLORKEYENABLE 0x00000020l
#define D3DDP_DXW_DRAW2DSURFACE 0x00000040l
#define D3DDEVICEDESC1_SIZE 172
#define D3DDEVICEDESC5_SIZE 204
#define D3DDEVICEDESC6_SIZE 252
#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
#define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */
#ifndef D3DTSS_ADDRESS
#define D3DTSS_ADDRESS 12
#endif
#define LVERTEX_SIZE 32
#undef D3DFVF_RESERVED2
#define D3DFVF_RESERVED2 0xf000 // 4 reserved bits
#define D3DFVF_RESERVED2_9 0x6000 // 2 reserved bits
#undef D3DFVF_POSITION_MASK
#define D3DFVF_POSITION_MASK 0x00e
#define D3DFVF_POSITION_MASK_9 0x400E
#define D3DFVF_LVERTEX9 (D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1)
typedef struct {
FLOAT x, y, z;
D3DCOLOR diffuse, specular;
FLOAT tu, tv;
} D3DLVERTEX9, *LPD3DLVERTEX9;
void ConvertLight(D3DLIGHT& Light, D3DLIGHT7& Light7);
void ConvertLight(D3DLIGHT7& Light7, D3DLIGHT& Light);
void ConvertMaterial(D3DMATERIAL &Material, D3DMATERIAL7 &Material7);
void ConvertMaterial(D3DMATERIAL7 &Material7, D3DMATERIAL &Material);
void ConvertViewport(D3DVIEWPORT &ViewPort, D3DVIEWPORT2 &ViewPort2);
void ConvertViewport(D3DVIEWPORT2 &ViewPort2, D3DVIEWPORT &ViewPort);
void ConvertViewport(D3DVIEWPORT &ViewPort, D3DVIEWPORT7 &ViewPort7);
void ConvertViewport(D3DVIEWPORT2 &ViewPort2, D3DVIEWPORT7 &ViewPort7);
void ConvertViewport(D3DVIEWPORT7 &ViewPort7, D3DVIEWPORT &ViewPort);
void ConvertViewport(D3DVIEWPORT7 &ViewPort7, D3DVIEWPORT2 &ViewPort2);
void ConvertViewport(D3DVIEWPORT7 &ViewPort, D3DVIEWPORT7 &ViewPort7);
void ConvertDeviceDesc(D3DDEVICEDESC &Desc, D3DDEVICEDESC7 &Desc7);
void ConvertDeviceDescSoft(D3DDEVICEDESC &Desc);
void ConvertDeviceDesc(D3DDEVICEDESC7 &Desc7, D3DCAPS9 &Caps9);
void ConvertVertices(D3DLVERTEX* lFVF, D3DLVERTEX9* lFVF9, DWORD NumVertices);
void ConvertVertices(D3DLVERTEX9* lFVF9, D3DLVERTEX* lFVF, DWORD NumVertices);
bool CheckTextureStageStateType(D3DTEXTURESTAGESTATETYPE dwState);
bool CheckRenderStateType(D3DRENDERSTATETYPE dwRenderStateType);
UINT GetVertexStride(DWORD dwVertexTypeDesc);
UINT GetNumberOfPrimitives(D3DPRIMITIVETYPE dptPrimitiveType, DWORD dwVertexCount);
|
ae669276ca51c5bd9c601526b89b2bcafdcbbae6
|
321d11eaee885ceb3a74db0a062f9bbdf282148c
|
/crypto/x509/x509_d2.c
|
7838b703d46a17847090bcd22bfbbb21893e447e
|
[
"Apache-2.0",
"OpenSSL",
"LicenseRef-scancode-proprietary-license"
] |
permissive
|
openssl/openssl
|
75691ebaae957793f2ff0673f77545277dfb3988
|
5318c012885a5382eadbf95aa9c1d35664bca819
|
refs/heads/master
| 2023-09-03T15:22:52.727123
| 2023-09-01T07:10:49
| 2023-09-02T14:30:01
| 7,634,677
| 24,148
| 11,569
|
Apache-2.0
| 2023-09-14T19:48:11
| 2013-01-15T22:34:48
|
C
|
UTF-8
|
C
| false
| false
| 3,257
|
c
|
x509_d2.c
|
/*
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/crypto.h>
#include <openssl/x509.h>
int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OSSL_LIB_CTX *libctx,
const char *propq)
{
X509_LOOKUP *lookup;
lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file());
if (lookup == NULL)
return 0;
X509_LOOKUP_load_file_ex(lookup, NULL, X509_FILETYPE_DEFAULT, libctx, propq);
lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_hash_dir());
if (lookup == NULL)
return 0;
X509_LOOKUP_add_dir(lookup, NULL, X509_FILETYPE_DEFAULT);
lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_store());
if (lookup == NULL)
return 0;
X509_LOOKUP_add_store_ex(lookup, NULL, libctx, propq);
/* clear any errors */
ERR_clear_error();
return 1;
}
int X509_STORE_set_default_paths(X509_STORE *ctx)
{
return X509_STORE_set_default_paths_ex(ctx, NULL, NULL);
}
int X509_STORE_load_file_ex(X509_STORE *ctx, const char *file,
OSSL_LIB_CTX *libctx, const char *propq)
{
X509_LOOKUP *lookup;
if (file == NULL
|| (lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file())) == NULL
|| X509_LOOKUP_load_file_ex(lookup, file, X509_FILETYPE_PEM, libctx,
propq) <= 0)
return 0;
return 1;
}
int X509_STORE_load_file(X509_STORE *ctx, const char *file)
{
return X509_STORE_load_file_ex(ctx, file, NULL, NULL);
}
int X509_STORE_load_path(X509_STORE *ctx, const char *path)
{
X509_LOOKUP *lookup;
if (path == NULL
|| (lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_hash_dir())) == NULL
|| X509_LOOKUP_add_dir(lookup, path, X509_FILETYPE_PEM) <= 0)
return 0;
return 1;
}
int X509_STORE_load_store_ex(X509_STORE *ctx, const char *uri,
OSSL_LIB_CTX *libctx, const char *propq)
{
X509_LOOKUP *lookup;
if (uri == NULL
|| (lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_store())) == NULL
|| X509_LOOKUP_add_store_ex(lookup, uri, libctx, propq) == 0)
return 0;
return 1;
}
int X509_STORE_load_store(X509_STORE *ctx, const char *uri)
{
return X509_STORE_load_store_ex(ctx, uri, NULL, NULL);
}
int X509_STORE_load_locations_ex(X509_STORE *ctx, const char *file,
const char *path, OSSL_LIB_CTX *libctx,
const char *propq)
{
if (file == NULL && path == NULL)
return 0;
if (file != NULL && !X509_STORE_load_file_ex(ctx, file, libctx, propq))
return 0;
if (path != NULL && !X509_STORE_load_path(ctx, path))
return 0;
return 1;
}
int X509_STORE_load_locations(X509_STORE *ctx, const char *file,
const char *path)
{
return X509_STORE_load_locations_ex(ctx, file, path, NULL, NULL);
}
|
7cc6fc0be6c24f4e4e4f2595981a1b3bd93121eb
|
4c195550263eb39db62a95820dde869f4bfd9606
|
/examples/extra/nearest.c
|
f4f2fd87ac780b811ba3356aed41d8497c7a271f
|
[
"Apache-2.0"
] |
permissive
|
ecmwf/eccodes
|
765584026fdc454b0f915831007c9cece28fe3a9
|
28ece2bbdb963a937ddd36958049f05f2110fa12
|
refs/heads/develop
| 2023-08-08T03:26:38.255559
| 2023-08-07T16:04:22
| 2023-08-07T16:04:22
| 161,228,639
| 155
| 87
|
Apache-2.0
| 2023-08-30T16:10:06
| 2018-12-10T19:52:30
|
C++
|
UTF-8
|
C
| false
| false
| 2,043
|
c
|
nearest.c
|
/*
*
* Name: nearest
*
* Description:
* Get the nearest for all the messages in the input grib file.
* No land-sea mask applied yet. Print the nearest values to
* stdout with high precision.
*
* Author: Cristian D Codorean
*/
#include <stdio.h>
#include <stdlib.h>
#include "grib_api.h"
void usage(char* name) {
printf("Usage is: %s lat lon input1 [input2 ...]\n",name);
}
int main(int argc, char** argv) {
grib_handle* h = NULL;
FILE* file_handle = NULL;
int err = 0;
int i = 0;
int nfiles = 0;
int shift = 3;
/* results */
double outlat=0;
double outlon=0;
double value=0;
double distance=0;
int index=0;
size_t size=1;
/* program inputs */
double lat =0,lon = 0;
char** file_names = NULL;
/* just some input validation */
if (argc < 4) {
usage(argv[0]);
exit(EXIT_FAILURE);
}
lat = atof(argv[1]);
lon = atof(argv[2]);
nfiles = argc - shift;
file_names = (char**)malloc(nfiles*sizeof(char*));
for (i = 0; i < nfiles; i++) {
file_names[i] = strdup(argv[i+shift]);
}
for (i = 0; i < nfiles; i++) {
/* open the input file */
file_handle = fopen(file_names[i],"r");
if (!file_handle) {
printf("Could not open file %s\n",file_names[i]);
exit(EXIT_FAILURE);
}
/* loop over all messages */
while (h = grib_handle_new_from_file(0,file_handle,&err)) {
if (err != GRIB_SUCCESS) GRIB_CHECK(err,0);
GRIB_CHECK(grib_nearest_find_multiple(h,0,&lat,&lon,1,&outlat,&outlon,&value,&distance,&index),0);
/*printf("outlat: %lf outlon: %lf value: %.10lf distance: %lf index: %d\n",
outlat, outlon, value, distance, index);*/
printf("%.10lf\n",value);
GRIB_CHECK(grib_handle_delete(h),0);
}
fclose(file_handle);
}
for (i = 0; i < nfiles; i++)
free(file_names[i]);
return 0;
}
|
39d686c50a64f79fdfc0af5a125b2bc3539c4391
|
298165e437bd9251128015c812a84e80b9e94d54
|
/application/para_check.h
|
b04b79a440d1268efcc312d5529b9a9b33915cff
|
[
"Apache-2.0"
] |
permissive
|
Xtra-Computing/ThunderGP
|
617e795e191a6122774717489a1e6f6f2dd2b29e
|
c316a34d241f0ea2b619cbf6b52db9e8aed3662b
|
refs/heads/master
| 2023-04-14T04:49:41.815314
| 2022-10-11T08:32:19
| 2022-10-11T08:32:19
| 254,307,005
| 111
| 31
|
Apache-2.0
| 2020-07-24T09:50:39
| 2020-04-09T07:54:52
|
C++
|
UTF-8
|
C
| false
| false
| 295
|
h
|
para_check.h
|
#ifndef __PARA_CHECK__
#define __PARA_CHECK__
#ifndef SUB_PARTITION_NUM
#error "SUB_PARTITION_NUM is not define! please check the ThunderGP para_gen."
#endif
#ifndef PARTITION_SIZE
#error "PARTITION_SIZE is not define! please check the ThunderGP para_gen."
#endif
#endif /* __PARA_CHECK__ */
|
155f4002c4fc6470e7b7d61374b95330d8ee0850
|
f3eed0234b4d0ad2bbb2abd700cf1e2c7a0e8a1d
|
/AKWF-c/AKWF_0006/AKWF_0535.h
|
f9b1ba44a8fc402c6623f3d3a8518c6815e6a190
|
[
"CC0-1.0"
] |
permissive
|
KristofferKarlAxelEkstrand/AKWF-FREE
|
b2defa1a2d389d309be6dd2e9f968923daf80d1b
|
cf8171df36e9fec25416b5f568b72a6e2cb69194
|
refs/heads/master
| 2023-07-23T18:22:36.939705
| 2023-07-10T17:14:40
| 2023-07-10T17:14:40
| 145,817,187
| 359
| 59
|
CC0-1.0
| 2023-07-10T17:14:41
| 2018-08-23T07:26:56
| null |
UTF-8
|
C
| false
| false
| 4,672
|
h
|
AKWF_0535.h
|
/* Adventure Kid Waveforms (AKWF) converted for use with Teensy Audio Library
*
* Adventure Kid Waveforms(AKWF) Open waveforms library
* https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/
*
* This code is in the public domain, CC0 1.0 Universal (CC0 1.0)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* Converted by Brad Roy, https://github.com/prosper00
*/
/* AKWF_0535 256 samples
+-----------------------------------------------------------------------------------------------------------------+
|*************************************************************************************************** |
|*************************************************************************************************** |
|*************************************************************************************************** |
|*************************************************************************************************** |
|*************************************************************************************************** |
|*************************************************************************************************** |
|*************************************************************************************************** |
| ************************************************************************************************* ************|
| * *************|
| ***************|
| ***************|
| ***************|
| ***************|
| **************|
| **************|
+-----------------------------------------------------------------------------------------------------------------+
*/
const uint16_t AKWF_0535 [] = {
47746, 59463, 49979, 55508, 54796, 51161, 50126, 49510, 49278, 49158, 49130, 49073, 49115, 49043, 49122, 49029,
49130, 49024, 49132, 49023, 49131, 49027, 49125, 49032, 49118, 49041, 49109, 49050, 49100, 49060, 49091, 49068,
49083, 49075, 49077, 49080, 49072, 49085, 49070, 49086, 49068, 49088, 49069, 49087, 49069, 49085, 49071, 49084,
49072, 49083, 49073, 49081, 49075, 49080, 49077, 49078, 49077, 49078, 49078, 49077, 49078, 49076, 49078, 49076,
49078, 49077, 49078, 49076, 49078, 49076, 49078, 49077, 49077, 49077, 49077, 49077, 49077, 49077, 49077, 49078,
49078, 49077, 49077, 49078, 49077, 49077, 49077, 49077, 49078, 49077, 49078, 49078, 49077, 49077, 49078, 49078,
49077, 49077, 49078, 49077, 49078, 49078, 49077, 49078, 49078, 49077, 49078, 49078, 49077, 49078, 49078, 49077,
49078, 49077, 49078, 49077, 49078, 49077, 49077, 49077, 49077, 49077, 49077, 49077, 49077, 49078, 49077, 49077,
49078, 49077, 49078, 49077, 49077, 49077, 49078, 49077, 49078, 49077, 49078, 49077, 49078, 49077, 49079, 49077,
49077, 49077, 49078, 49077, 49078, 49077, 49078, 49077, 49076, 49078, 49077, 49079, 49075, 49080, 49074, 49082,
49073, 49083, 49072, 49084, 49070, 49085, 49070, 49085, 49070, 49084, 49071, 49081, 49075, 49078, 49079, 49073,
49086, 49065, 49094, 49056, 49104, 49047, 49113, 49038, 49122, 49028, 49129, 49022, 49134, 49022, 49132, 49026,
49124, 49038, 49108, 49058, 49084, 49086, 49050, 49124, 49009, 49168, 48961, 49220, 48908, 49274, 48855, 49326,
48804, 49374, 48761, 49410, 48733, 49430, 48725, 49422, 48753, 49368, 48843, 49223, 49080, 48806, 49758, 14969,
5423, 12460, 13190, 16368, 15226, 17002, 15737, 17028, 15929, 16947, 16050, 16850, 16151, 16757, 16243, 16668,
16330, 16584, 16412, 16501, 16494, 16417, 16582, 16325, 16683, 16211, 16817, 16046, 17039, 15719, 17599, 14430,
};
|
43ebb1ea381db7f54be1a3a195c1519f5d1fca76
|
78dc9f153549b281be709227bc9897931b06260d
|
/generation/WinSDK/RecompiledIdlHeaders/um/networkisolation.h
|
040e1d7f512a4ee7e358691884fed5c395b06c3c
|
[
"MIT"
] |
permissive
|
microsoft/win32metadata
|
dff35b4fe904d556162cee5133294c4498f1a79a
|
5bf233f04d45f7a697e112e9639722551103eb07
|
refs/heads/main
| 2023-09-01T19:51:22.972899
| 2023-08-30T21:39:44
| 2023-08-30T21:39:44
| 270,838,404
| 1,240
| 107
|
NOASSERTION
| 2023-09-14T18:49:44
| 2020-06-08T21:52:10
|
C++
|
UTF-8
|
C
| false
| false
| 5,111
|
h
|
networkisolation.h
|
/********************************************************************************
* *
* netiso.h -- ApiSet Contract for api-ms-win-netsec-isolation-l1 *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
********************************************************************************/
#pragma once
#ifndef _NETISO_H_
#define _NETISO_H_
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#include <minwinbase.h>
#if NTDDI_VERSION >= NTDDI_WIN8
#ifdef __cplusplus
extern "C" {
#endif
#pragma region Desktop Family or Firewall Package
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PKG_MPSSVC)
#ifndef __NET_ISOLATION_TYPES__
#define __NET_ISOLATION_TYPES__
typedef enum NETISO_FLAG
{
NETISO_FLAG_FORCE_COMPUTE_BINARIES = 0x1,
NETISO_FLAG_MAX = 0x2
} NETISO_FLAG;
typedef enum _INET_FIREWALL_AC_CREATION_TYPE
{
INET_FIREWALL_AC_NONE = 0x00,
INET_FIREWALL_AC_PACKAGE_ID_ONLY = 0x01,
INET_FIREWALL_AC_BINARY = 0x02,
INET_FIREWALL_AC_MAX = 0x04
} INET_FIREWALL_AC_CREATION_TYPE;
typedef enum _INET_FIREWALL_AC_CHANGE_TYPE
{
INET_FIREWALL_AC_CHANGE_INVALID = 0,
INET_FIREWALL_AC_CHANGE_CREATE = 1,
INET_FIREWALL_AC_CHANGE_DELETE = 2,
INET_FIREWALL_AC_CHANGE_MAX = 3
} INET_FIREWALL_AC_CHANGE_TYPE;
typedef struct _INET_FIREWALL_AC_CAPABILITIES
{
DWORD count;
SID_AND_ATTRIBUTES * capabilities;
} INET_FIREWALL_AC_CAPABILITIES, *PINET_FIREWALL_AC_CAPABILITIES;
typedef struct _INET_FIREWALL_AC_BINARIES
{
DWORD count;
LPWSTR *binaries;
} INET_FIREWALL_AC_BINARIES, *PINET_FIREWALL_AC_BINARIES;
typedef struct _INET_FIREWALL_AC_CHANGE
{
INET_FIREWALL_AC_CHANGE_TYPE changeType;
INET_FIREWALL_AC_CREATION_TYPE createType;
SID *appContainerSid;
SID* userSid;
LPWSTR displayName;
union
{
INET_FIREWALL_AC_CAPABILITIES capabilities;
INET_FIREWALL_AC_BINARIES binaries;
} u;
} INET_FIREWALL_AC_CHANGE, *PINET_FIREWALL_AC_CHANGE;
typedef struct _INET_FIREWALL_APP_CONTAINER
{
SID *appContainerSid;
SID *userSid;
LPWSTR appContainerName;
LPWSTR displayName;
LPWSTR description;
INET_FIREWALL_AC_CAPABILITIES capabilities;
INET_FIREWALL_AC_BINARIES binaries;
LPWSTR workingDirectory;
LPWSTR packageFullName;
} INET_FIREWALL_APP_CONTAINER, *PINET_FIREWALL_APP_CONTAINER;
#endif //__NET_ISOLATION_TYPES__
typedef void (CALLBACK *PAC_CHANGES_CALLBACK_FN) (
_In_opt_ void *context,
_In_ const INET_FIREWALL_AC_CHANGE *pChange
);
HRESULT
WINAPI
NetworkIsolationSetupAppContainerBinaries(
_In_ PSID applicationContainerSid,
_In_ LPCWSTR packageFullName,
_In_ LPCWSTR packageFolder,
_In_ LPCWSTR displayName,
_In_ BOOL bBinariesFullyComputed,
_In_reads_(binariesCount) LPCWSTR* binaries,
_In_ DWORD binariesCount
);
DWORD
WINAPI
NetworkIsolationRegisterForAppContainerChanges(
_In_ DWORD flags,
_In_ PAC_CHANGES_CALLBACK_FN callback,
_In_opt_ PVOID context,
_Out_ HANDLE* registrationObject
);
DWORD
WINAPI
NetworkIsolationUnregisterForAppContainerChanges(
_In_ HANDLE registrationObject
);
//APISET
//DLOAD_RET(ERROR_NOT_SUPPORTED)
//HRESULT
//WINAPI
//NetworkIsolationEnumerateAppContainerRules(
// API_SAL("_Outptr_") IEnumVARIANT ** newEnum
// );
DWORD
WINAPI
NetworkIsolationFreeAppContainers(
_In_ PINET_FIREWALL_APP_CONTAINER pPublicAppCs
);
DWORD
WINAPI
NetworkIsolationEnumAppContainers(
DWORD Flags,
_Out_ DWORD* pdwNumPublicAppCs,
_Outptr_result_buffer_(*pdwNumPublicAppCs) PINET_FIREWALL_APP_CONTAINER* ppPublicAppCs
);
DWORD
WINAPI
NetworkIsolationGetAppContainerConfig(
_Out_ DWORD* pdwNumPublicAppCs,
_Outptr_result_buffer_(*pdwNumPublicAppCs) PSID_AND_ATTRIBUTES* appContainerSids
);
DWORD
WINAPI
NetworkIsolationSetAppContainerConfig(
_In_ DWORD dwNumPublicAppCs,
_In_reads_(dwNumPublicAppCs) PSID_AND_ATTRIBUTES appContainerSids
);
#ifndef __NET_ISOLATION_DIAG_TYPES__
#define __NET_ISOLATION_DIAG_TYPES__
typedef enum _NETISO_ERROR_TYPE
{
NETISO_ERROR_TYPE_NONE = 0x00,
NETISO_ERROR_TYPE_PRIVATE_NETWORK = 0x01,
NETISO_ERROR_TYPE_INTERNET_CLIENT = 0x02,
NETISO_ERROR_TYPE_INTERNET_CLIENT_SERVER = 0x03,
NETISO_ERROR_TYPE_MAX = 0x04
} NETISO_ERROR_TYPE;
#endif //__NET_ISOLATION_DIAG_TYPES__
DWORD
NetworkIsolationDiagnoseConnectFailure(
__in LPCWSTR wszServerName
);
DWORD
WINAPI
NetworkIsolationDiagnoseConnectFailureAndGetInfo(
_In_ LPCWSTR wszServerName,
_Out_ NETISO_ERROR_TYPE* netIsoError
);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PKG_MPSSVC)
#pragma endregion
#ifdef __cplusplus
}
#endif
#endif // NTDDI
#endif // _NETISO_H_
|
1736b6b9029a7356094628494012f941105cd07a
|
09ad211d426e093aec7e674334834f1de188548e
|
/Chapter06/06_multigpu/04_gaussian_multi_node/mpiUtils.h
|
8a508d71babed11fd4a5c4788618640dee65d8d2
|
[
"MIT"
] |
permissive
|
PacktPublishing/Learn-CUDA-Programming
|
b818f4766304bfe7b45719ad7c11c4d4dc08a2f5
|
2d0abbeeea9fbba79ef6cd63bef4148e4c00b1ac
|
refs/heads/master
| 2023-08-29T10:12:33.682703
| 2023-04-04T18:20:33
| 2023-04-04T18:20:33
| 140,380,398
| 722
| 201
|
MIT
| 2023-04-04T18:20:34
| 2018-07-10T05:14:55
|
Cuda
|
UTF-8
|
C
| false
| false
| 223
|
h
|
mpiUtils.h
|
#ifndef MPIUTILS_H
#define MPIUTILS_H
#include <mpi.h>
#define MPI_CHECK(call) \
if((call) != MPI_SUCCESS) { \
printf("MPI error calling \"%s\"\n", #call); \
MPI_Abort(MPI_COMM_WORLD, -1); }
#endif
|
52299070479d322998c8cd35d3e9095e669d54d3
|
d84c7df450292867f8c7bb58d1507735479d746d
|
/tests/t402-qfunction.c
|
b0d4930a8cbc2b1f1e10f1fcb978f3b6fee96831
|
[
"BSD-2-Clause",
"BSD-3-Clause"
] |
permissive
|
CEED/libCEED
|
c17e8b2f8e9ccfafc0505bb6db451e2f7cfed690
|
c6c10e0994b55ea1726a79024cd4c333c40de38a
|
refs/heads/main
| 2023-09-01T20:13:21.268643
| 2023-09-01T20:08:36
| 2023-09-01T20:08:36
| 113,349,904
| 167
| 54
|
BSD-2-Clause
| 2023-09-14T20:37:58
| 2017-12-06T17:57:40
|
C
|
UTF-8
|
C
| false
| false
| 1,487
|
c
|
t402-qfunction.c
|
/// @file
/// Test viewing of QFunction
/// \test Test viewing of QFunction
#include <ceed.h>
#include <stdio.h>
#include "t400-qfunction.h"
int main(int argc, char **argv) {
Ceed ceed;
CeedQFunction qf_setup, qf_mass;
CeedQFunctionContext ctx;
CeedInit(argv[1], &ceed);
CeedQFunctionCreateInterior(ceed, 1, setup, setup_loc, &qf_setup);
CeedQFunctionAddInput(qf_setup, "w", 1, CEED_EVAL_WEIGHT);
CeedQFunctionAddOutput(qf_setup, "q data", 1, CEED_EVAL_NONE);
CeedQFunctionCreateInterior(ceed, 1, mass, mass_loc, &qf_mass);
CeedQFunctionAddInput(qf_mass, "q data", 1, CEED_EVAL_NONE);
CeedQFunctionAddInput(qf_mass, "u", 1, CEED_EVAL_INTERP);
CeedQFunctionAddOutput(qf_mass, "v", 1, CEED_EVAL_INTERP);
CeedQFunctionView(qf_setup, stdout);
CeedQFunctionView(qf_mass, stdout);
CeedQFunctionContextCreate(ceed, &ctx);
if (CEED_SCALAR_TYPE == CEED_SCALAR_FP64) {
CeedScalar ctxData[5] = {1, 2, 3, 4, 5};
CeedQFunctionContextSetData(ctx, CEED_MEM_HOST, CEED_COPY_VALUES, sizeof(ctxData), &ctxData);
} else { // Make context twice as long so the size is the same in output
CeedScalar ctxData[10] = {1, 2, 3, 4, 5, 1, 2, 3, 4, 5};
CeedQFunctionContextSetData(ctx, CEED_MEM_HOST, CEED_COPY_VALUES, sizeof(ctxData), &ctxData);
}
CeedQFunctionContextView(ctx, stdout);
CeedQFunctionDestroy(&qf_setup);
CeedQFunctionDestroy(&qf_mass);
CeedQFunctionContextDestroy(&ctx);
CeedDestroy(&ceed);
return 0;
}
|
7b627c4bd090b4cefee042a709a094cdf0e15032
|
7b425379c2d00c0cb327d0f4924b0e1afdc6647f
|
/include/caffe/cc/import/import-staticlib.h
|
a944156c6df281fe5c1868f77c2c8f7330cc5dce
|
[] |
no_license
|
dlunion/CC4.0
|
4f1e07bd724adaebe50f7872ccc73c87e25bc217
|
6fb51e494b6a88f0987b9dd99117ec21766e3aee
|
refs/heads/master
| 2021-04-26T23:10:38.427504
| 2020-01-15T13:11:23
| 2020-01-15T13:11:23
| 123,939,618
| 171
| 76
| null | 2020-01-15T13:11:25
| 2018-03-05T15:29:43
|
C++
|
UTF-8
|
C
| false
| false
| 143
|
h
|
import-staticlib.h
|
#pragma once
#include "import-caffe-staticlib.h"
#include "import-opencv-staticlib.h"
#ifndef CPU_ONLY
#include "import-cuda-lib.h"
#endif
|
bc4a85994584dbb8dedf173a9e7bdaa7f2b80e37
|
060bc5ba9a8f707bdac927f30842febf9a4676a1
|
/usr.bin/vi/sex/sex_screen.c
|
8f15429a5a3cab4f7b8472e4b946f6dd5e00d334
|
[
"BSD-4-Clause-UC",
"LicenseRef-scancode-other-permissive"
] |
permissive
|
sergev/LiteBSD
|
14ae93caa709d4707c3b122c243641c8214583c3
|
6f89c18880065a83d3d18661c80f72fb3397a888
|
refs/heads/master
| 2023-01-10T02:20:05.357875
| 2022-07-19T16:41:32
| 2022-07-19T16:41:32
| 19,167,171
| 318
| 58
|
NOASSERTION
| 2022-12-28T16:23:01
| 2014-04-26T02:55:34
|
C
|
UTF-8
|
C
| false
| false
| 14,209
|
c
|
sex_screen.c
|
/*-
* Copyright (c) 1993, 1994
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 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 lint
static char sccsid[] = "@(#)sex_screen.c 9.2 (Berkeley) 11/10/94";
#endif /* not lint */
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <bitstring.h>
#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include "compat.h"
#include <curses.h>
#include <db.h>
#include <regex.h>
#include <pathnames.h>
#include "vi.h"
#include "excmd.h"
#include "sex_screen.h"
#include "../svi/svi_screen.h"
enum rc { NOEXIST, NOPERM, RCOK };
static enum rc exrc_isok __P((SCR *, struct stat *, char *, int, int));
static void sex_abort __P((void));
static int sex_noop __P((void));
static int sex_nope __P((SCR *));
static void sex_screen_init __P((SCR *));
static int sex_screen_setup __P((SCR *, struct termios *));
static int sex_screen_teardown __P((SCR *, struct termios *, int));
/*
* sex_screen_copy --
* Copy to a new screen.
*/
int
sex_screen_copy(orig, sp)
SCR *orig, *sp;
{
SEX_PRIVATE *osex, *nsex;
/* Create the private screen structure. */
CALLOC_RET(orig, nsex, SEX_PRIVATE *, 1, sizeof(SEX_PRIVATE));
sp->sex_private = nsex;
/* INITIALIZED AT SCREEN CREATE. */
/* PARTIALLY OR COMPLETELY COPIED FROM PREVIOUS SCREEN. */
if (orig == NULL) {
} else {
osex = SXP(orig);
#ifndef SYSV_CURSES
if (osex->SE != NULL && (nsex->SE = strdup(osex->SE)) == NULL) {
msgq(sp, M_SYSERR, NULL);
return (1);
}
if (osex->SO != NULL && (nsex->SO = strdup(osex->SO)) == NULL) {
msgq(sp, M_SYSERR, NULL);
free(osex->SE);
return (1);
}
#endif
}
return (0);
}
/*
* sex_screen_end --
* End a screen.
*/
int
sex_screen_end(sp)
SCR *sp;
{
#ifndef SYSV_CURSES
/* Free inverse video strings. */
if (SXP(sp)->SE != NULL)
free(SXP(sp)->SE);
if (SXP(sp)->SO != NULL)
free(SXP(sp)->SO);
#endif
/* Free private memory. */
FREE(SXP(sp), sizeof(SEX_PRIVATE));
sp->sex_private = NULL;
return (0);
}
#define PFLAGS (EXPAR_BLIGNORE | EXPAR_NOAUTO | EXPAR_NOPRDEF | EXPAR_VLITONLY)
#define RUN_EXRC(p) { \
(void)ex_cfile(sp, p, PFLAGS); \
if (F_ISSET(sp, S_EXIT | S_EXIT_FORCE)) \
goto ret; \
}
#define RUN_ICMD(s) { \
(void)ex_icmd(sp, s, strlen(s), PFLAGS); \
if (F_ISSET(sp, S_EXIT | S_EXIT_FORCE)) \
goto ret; \
}
/*
* sex_screen_icmd --
* Execute the command-line ex commands. This code is here because it
* has to run in ex mode. This code sets up and tears down ex so that
* it's transparent.
*/
int
sex_screen_icmd(sp, s)
SCR *sp;
char *s;
{
struct termios t;
if (sex_screen_setup(sp, &t))
return (1);
RUN_ICMD(s);
ret: return (sex_screen_teardown(sp,
&t, !F_ISSET(sp, S_EXIT | S_EXIT_FORCE)));
}
/*
* sex_screen_exrc --
* Read the EXINIT environment variable and the startup exrc files,
* and execute their commands. This code is here because it has to
* run in ex mode. This code sets up and tears down ex so that it's
* transparent.
*/
int
sex_screen_exrc(sp)
SCR *sp;
{
struct termios t;
struct stat hsb, lsb;
int rval;
char *p, path[MAXPATHLEN];
if (sex_screen_setup(sp, &t))
return (1);
/*
* Source the system, environment, $HOME and local .exrc values.
* Vi historically didn't check $HOME/.exrc if the environment
* variable EXINIT was set. This is all done before the file is
* read in, because things in the .exrc information can set, for
* example, the recovery directory.
*
* !!!
* While nvi can handle any of the options settings of historic vi,
* the converse is not true. Since users are going to have to have
* files and environmental variables that work with both, we use nvi
* versions of both the $HOME and local startup files if they exist,
* otherwise the historic ones.
*
* !!!
* For a discussion of permissions and when what .exrc files are
* read, see the comment above the exrc_isok() function below.
*
* !!!
* If the user started the historic of vi in $HOME, vi read the user's
* .exrc file twice, as $HOME/.exrc and as ./.exrc. We avoid this, as
* it's going to make some commands behave oddly, and I can't imagine
* anyone depending on it.
*/
rval = 0;
switch (exrc_isok(sp, &hsb, _PATH_SYSEXRC, 1, 0)) {
case NOEXIST:
case NOPERM:
break;
case RCOK:
RUN_EXRC(_PATH_SYSEXRC);
break;
}
if ((p = getenv("NEXINIT")) != NULL || (p = getenv("EXINIT")) != NULL)
if ((p = strdup(p)) == NULL) {
rval = 1;
msgq(sp, M_SYSERR, NULL);
goto ret;
} else {
RUN_ICMD(p);
free(p);
}
else if ((p = getenv("HOME")) != NULL && *p) {
(void)snprintf(path, sizeof(path), "%s/%s", p, _PATH_NEXRC);
switch (exrc_isok(sp, &hsb, path, 0, 1)) {
case NOEXIST:
(void)snprintf(path,
sizeof(path), "%s/%s", p, _PATH_EXRC);
if (exrc_isok(sp, &hsb, path, 0, 1) == RCOK)
RUN_EXRC(path);
break;
case NOPERM:
break;
case RCOK:
RUN_EXRC(path);
break;
}
}
if (O_ISSET(sp, O_EXRC))
switch (exrc_isok(sp, &lsb, _PATH_NEXRC, 0, 0)) {
case NOEXIST:
if (exrc_isok(sp, &lsb, _PATH_EXRC, 0, 0) == RCOK &&
(lsb.st_dev != hsb.st_dev ||
lsb.st_ino != hsb.st_ino))
RUN_EXRC(_PATH_EXRC);
break;
case NOPERM:
break;
case RCOK:
if (lsb.st_dev != hsb.st_dev ||
lsb.st_ino != hsb.st_ino)
RUN_EXRC(_PATH_NEXRC);
break;
}
ret: return (sex_screen_teardown(sp,
&t, !F_ISSET(sp, S_EXIT | S_EXIT_FORCE)) || rval);
}
/*
* sex_screen_edit --
* Main ex screen loop. The ex screen is relatively uncomplicated.
* As long as it has a stdio FILE pointer for output, it's happy.
*/
int
sex_screen_edit(sp)
SCR *sp;
{
struct termios t;
int escreen, force, rval;
escreen = 0;
if (sex_screen_setup(sp, &t))
return (1);
for (;;) {
/*
* Run ex. If ex fails, sex data structures
* may be corrupted, be careful what you do.
*/
if (rval = ex(sp)) {
(void)rcv_sync(sp,
RCV_EMAIL | RCV_ENDSESSION | RCV_PRESERVE);
escreen = 1;
break;
}
force = 0;
switch (F_ISSET(sp, S_MAJOR_CHANGE)) {
case S_EXIT_FORCE:
force = 1;
/* FALLTHROUGH */
case S_EXIT:
F_CLR(sp, S_EXIT_FORCE | S_EXIT);
if (file_end(sp, NULL, force))
break;
escreen = 1;
/* FALLTHROUGH */
case 0: /* Changing from ex mode. */
goto ret;
case S_SSWITCH:
default:
abort();
}
}
ret: if (sex_screen_teardown(sp, &t, 0))
rval = 1;
if (escreen && screen_end(sp))
rval = 1;
return (rval);
}
/*
* sex_screen_setup --
* Set up the ex screen.
*/
static int
sex_screen_setup(sp, tp)
SCR *sp;
struct termios *tp;
{
/*
* The resize bit may be set, but clear it, we're going to
* initialize the screen right now.
*/
F_CLR(sp, S_SCR_RESIZE);
/* Initialize the function set. */
sex_screen_init(sp);
/* Initialize the terminal state. */
if (F_ISSET(sp->gp, G_STDIN_TTY))
SEX_RAW(tp);
sp->rows = O_VAL(sp, O_LINES);
sp->cols = O_VAL(sp, O_COLUMNS);
return (0);
}
/*
* sex_screen_teardown --
* Tear down the ex screen.
*/
static int
sex_screen_teardown(sp, tp, needwait)
SCR *sp;
struct termios *tp;
int needwait;
{
CH ikey;
int rval;
/* Reset the terminal state. */
rval = F_ISSET(sp->gp, G_STDIN_TTY) && SEX_NORAW(tp);
/* If the screen was dirtied, we have to wait. */
if (needwait && F_ISSET(sp, S_SCR_EXWROTE)) {
(void)write(STDOUT_FILENO, STR_CMSG, sizeof(STR_CMSG) - 1);
(void)term_key(sp, &ikey, 0);
}
return (rval);
}
/*
* exrc_isok --
* Check a .exrc file for source-ability.
*
* !!!
* Historically, vi read the $HOME and local .exrc files if they were owned
* by the user's real ID, or the "sourceany" option was set, regardless of
* any other considerations. We no longer support the sourceany option as
* it's a security problem of mammoth proportions. We require the system
* .exrc file to be owned by root, the $HOME .exrc file to be owned by the
* user's effective ID (or that the user's effective ID be root) and the
* local .exrc files to be owned by the user's effective ID. In all cases,
* the file cannot be writeable by anyone other than its owner.
*
* In O'Reilly ("Learning the VI Editor", Fifth Ed., May 1992, page 106),
* it notes that System V release 3.2 and later has an option "[no]exrc".
* The behavior is that local .exrc files are read only if the exrc option
* is set. The default for the exrc option was off, so, by default, local
* .exrc files were not read. The problem this was intended to solve was
* that System V permitted users to give away files, so there's no possible
* ownership or writeability test to ensure that the file is safe.
*
* POSIX 1003.2-1992 standardized exrc as an option. It required the exrc
* option to be off by default, thus local .exrc files are not to be read
* by default. The Rationale noted (incorrectly) that this was a change
* to historic practice, but correctly noted that a default of off improves
* system security. POSIX also required that vi check the effective user
* ID instead of the real user ID, which is why we've switched from historic
* practice.
*
* We initialize the exrc variable to off. If it's turned on by the system
* or $HOME .exrc files, and the local .exrc file passes the ownership and
* writeability tests, then we read it. This breaks historic 4BSD practice,
* but it gives us a measure of security on systems where users can give away
* files.
*/
static enum rc
exrc_isok(sp, sbp, path, rootown, rootid)
SCR *sp;
struct stat *sbp;
char *path;
int rootown, rootid;
{
enum { ROOTOWN, OWN, WRITER } etype;
uid_t euid;
int nf1, nf2;
char *a, *b, buf[MAXPATHLEN];
/* Check for the file's existence. */
if (stat(path, sbp))
return (NOEXIST);
/* Check ownership permissions. */
euid = geteuid();
if (!(rootown && sbp->st_uid == 0) &&
!(rootid && euid == 0) && sbp->st_uid != euid) {
etype = rootown ? ROOTOWN : OWN;
goto denied;
}
/* Check writeability. */
if (sbp->st_mode & (S_IWGRP | S_IWOTH)) {
etype = WRITER;
goto denied;
}
return (RCOK);
denied: a = msg_print(sp, path, &nf1);
if (strchr(path, '/') == NULL && getcwd(buf, sizeof(buf)) != NULL) {
b = msg_print(sp, buf, &nf2);
switch (etype) {
case ROOTOWN:
msgq(sp, M_ERR,
"043|%s/%s: not sourced: not owned by you or root",
b, a);
break;
case OWN:
msgq(sp, M_ERR,
"044|%s/%s: not sourced: not owned by you", b, a);
break;
case WRITER:
msgq(sp, M_ERR,
"045|%s/%s: not sourced: writeable by a user other than the owner", b, a);
break;
}
if (nf2)
FREE_SPACE(sp, b, 0);
} else
switch (etype) {
case ROOTOWN:
msgq(sp, M_ERR,
"046|%s: not sourced: not owned by you or root", a);
break;
case OWN:
msgq(sp, M_ERR,
"047|%s: not sourced: not owned by you", a);
break;
case WRITER:
msgq(sp, M_ERR,
"048|%s: not sourced: writeable by a user other than the owner", a);
break;
}
if (nf1)
FREE_SPACE(sp, a, 0);
return (NOPERM);
}
/*
* sex_screen_init --
* Initialize the ex screen.
*/
static void
sex_screen_init(sp)
SCR *sp;
{
/* Initialize support routines. */
sp->s_bell = sex_bell;
sp->s_bg = (int (*)())sex_nope;
sp->s_busy = (int (*)())sex_busy;
sp->s_change = (int (*)())sex_noop;
sp->s_clear = (int (*)())sex_noop;
sp->s_colpos = (size_t (*)())sex_abort;
sp->s_column = (int (*)())sex_abort;
sp->s_confirm = sex_confirm;
sp->s_crel = (int (*)())sex_nope;
sp->s_edit = sex_screen_edit;
sp->s_end = (int (*)())sex_noop;
sp->s_ex_cmd = (int (*)())sex_abort;
sp->s_ex_run = (int (*)())sex_abort;
sp->s_ex_write = (int (*)())sex_abort;
sp->s_fg = (int (*)())sex_nope;
sp->s_fill = (int (*)())sex_abort;
sp->s_get = sex_get;
sp->s_key_read = sex_key_read;
sp->s_fmap = (int (*)())sex_noop;
sp->s_position = (int (*)())sex_abort;
sp->s_rabs = (int (*)())sex_nope;
sp->s_rcm = (size_t (*)())sex_abort;
sp->s_refresh = sex_refresh;
sp->s_scroll = (int (*)())sex_abort;
sp->s_split = (int (*)())sex_nope;
sp->s_suspend = sex_suspend;
}
/*
* sex_abort --
* Fake function. Die.
*/
static void
sex_abort()
{
abort();
}
/*
* sex_noop --
* Fake function. Do nothing.
*/
static int
sex_noop()
{
return (0);
}
/*
* sex_nope --
* Fake function. Not in ex, you don't.
*/
static int
sex_nope(sp)
SCR *sp;
{
msgq(sp, M_ERR, "095|Command not available in ex mode");
return (1);
}
|
2c76341fbc33093d1a1d8b79ef9623be4dcc3b88
|
a12b448f44beb4d521cb7e31677281f41df35f0b
|
/3rdParty/isl/isl_aff_private.h
|
8ee5b00e04c3c01929a7e630bd0246db6c98e9f0
|
[
"MIT",
"LGPL-2.0-or-later"
] |
permissive
|
Tiramisu-Compiler/tiramisu
|
d45f65dd9c35f643b3531ec79df1203c7ea3371d
|
f13e480f0ddb142cec371b7d7431a41d8ca885ec
|
refs/heads/master
| 2023-08-25T12:21:26.889736
| 2023-05-09T18:40:52
| 2023-05-09T18:40:52
| 58,378,976
| 906
| 168
|
MIT
| 2023-09-08T11:47:06
| 2016-05-09T13:33:51
|
C++
|
UTF-8
|
C
| false
| false
| 5,092
|
h
|
isl_aff_private.h
|
#ifndef ISL_AFF_PRIVATE_H
#define ISL_AFF_PRIVATE_H
#include <isl/aff.h>
#include <isl/vec.h>
#include <isl/mat.h>
#include <isl/local_space.h>
#include <isl_int.h>
#include <isl_reordering.h>
/* ls represents the domain space.
*
* If the first two elements of "v" (the denominator and the constant term)
* are zero, then the isl_aff represents NaN.
*/
struct isl_aff {
int ref;
isl_local_space *ls;
isl_vec *v;
};
#undef EL
#define EL isl_aff
#include <isl_list_templ.h>
struct isl_pw_aff_piece {
struct isl_set *set;
struct isl_aff *aff;
};
struct isl_pw_aff {
int ref;
isl_space *dim;
int n;
size_t size;
struct isl_pw_aff_piece p[1];
};
#undef EL
#define EL isl_pw_aff
#include <isl_list_templ.h>
struct isl_pw_multi_aff_piece {
isl_set *set;
isl_multi_aff *maff;
};
struct isl_pw_multi_aff {
int ref;
isl_space *dim;
int n;
size_t size;
struct isl_pw_multi_aff_piece p[1];
};
__isl_give isl_aff *isl_aff_alloc_vec(__isl_take isl_local_space *ls,
__isl_take isl_vec *v);
__isl_give isl_aff *isl_aff_alloc(__isl_take isl_local_space *ls);
__isl_give isl_aff *isl_aff_reset_space_and_domain(__isl_take isl_aff *aff,
__isl_take isl_space *space, __isl_take isl_space *domain);
__isl_give isl_aff *isl_aff_reset_domain_space(__isl_take isl_aff *aff,
__isl_take isl_space *dim);
__isl_give isl_aff *isl_aff_realign_domain(__isl_take isl_aff *aff,
__isl_take isl_reordering *r);
__isl_give isl_aff *isl_aff_set_constant(__isl_take isl_aff *aff, isl_int v);
__isl_give isl_aff *isl_aff_set_coefficient(__isl_take isl_aff *aff,
enum isl_dim_type type, int pos, isl_int v);
__isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v);
int isl_aff_plain_cmp(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2);
__isl_give isl_aff *isl_aff_normalize(__isl_take isl_aff *aff);
__isl_give isl_aff *isl_aff_expand_divs( __isl_take isl_aff *aff,
__isl_take isl_mat *div, int *exp);
__isl_give isl_pw_aff *isl_pw_aff_alloc_size(__isl_take isl_space *space,
int n);
__isl_give isl_pw_aff *isl_pw_aff_reset_space(__isl_take isl_pw_aff *pwaff,
__isl_take isl_space *dim);
__isl_give isl_pw_aff *isl_pw_aff_reset_domain_space(
__isl_take isl_pw_aff *pwaff, __isl_take isl_space *space);
__isl_give isl_pw_aff *isl_pw_aff_add_disjoint(
__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2);
__isl_give isl_pw_aff *isl_pw_aff_union_opt(__isl_take isl_pw_aff *pwaff1,
__isl_take isl_pw_aff *pwaff2, int max);
__isl_give isl_pw_aff *isl_pw_aff_set_rational(__isl_take isl_pw_aff *pwaff);
__isl_give isl_pw_aff_list *isl_pw_aff_list_set_rational(
__isl_take isl_pw_aff_list *list);
__isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f);
__isl_give isl_pw_aff *isl_pw_aff_scale(__isl_take isl_pw_aff *pwaff,
isl_int f);
__isl_give isl_pw_aff *isl_pw_aff_scale_down(__isl_take isl_pw_aff *pwaff,
isl_int f);
isl_bool isl_aff_matching_params(__isl_keep isl_aff *aff,
__isl_keep isl_space *space);
isl_stat isl_aff_check_match_domain_space(__isl_keep isl_aff *aff,
__isl_keep isl_space *space);
#undef BASE
#define BASE aff
#include <isl_multi_templ.h>
__isl_give isl_multi_aff *isl_multi_aff_dup(__isl_keep isl_multi_aff *multi);
__isl_give isl_multi_aff *isl_multi_aff_align_divs(
__isl_take isl_multi_aff *maff);
__isl_give isl_multi_aff *isl_multi_aff_from_basic_set_equalities(
__isl_take isl_basic_set *bset);
__isl_give isl_multi_aff *isl_multi_aff_from_aff_mat(
__isl_take isl_space *space, __isl_take isl_mat *mat);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_domain_space(
__isl_take isl_pw_multi_aff *pwmaff, __isl_take isl_space *space);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_space(
__isl_take isl_pw_multi_aff *pwmaff, __isl_take isl_space *space);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_add_disjoint(
__isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_project_out(
__isl_take isl_pw_multi_aff *pma,
enum isl_dim_type type, unsigned first, unsigned n);
void isl_seq_preimage(isl_int *dst, isl_int *src,
__isl_keep isl_multi_aff *ma, int n_before, int n_after,
int n_div_ma, int n_div_bmap,
isl_int f, isl_int c1, isl_int c2, isl_int g, int has_denom);
__isl_give isl_aff *isl_aff_substitute_equalities(__isl_take isl_aff *aff,
__isl_take isl_basic_set *eq);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_substitute(
__isl_take isl_pw_multi_aff *pma, enum isl_dim_type type, unsigned pos,
__isl_keep isl_pw_aff *subs);
isl_bool isl_pw_aff_matching_params(__isl_keep isl_pw_aff *pa,
__isl_keep isl_space *space);
isl_stat isl_pw_aff_check_match_domain_space(__isl_keep isl_pw_aff *pa,
__isl_keep isl_space *space);
__isl_give isl_basic_set *isl_aff_pos_basic_set(__isl_take isl_aff *aff);
#undef BASE
#define BASE pw_aff
#include <isl_multi_templ.h>
#undef EL
#define EL isl_union_pw_aff
#include <isl_list_templ.h>
#undef BASE
#define BASE union_pw_aff
#include <isl_multi_templ.h>
#undef EL
#define EL isl_union_pw_multi_aff
#include <isl_list_templ.h>
#endif
|
d6027ce0c2117ba606a37b59f879e8a7d80f4c7f
|
ac2f43c8e0d9649a7f063c59b3dffdfed9fd7ed7
|
/common/recipes-lib/retimer-v2.09/files/aries_margin.c
|
9119c4e72e96eaf652db315e7af5fa2c3a02240f
|
[
"Apache-2.0"
] |
permissive
|
facebook/openbmc
|
bef10604ced226288600f55248b7f1be9945aea4
|
32777c66a8410d767eae15baabf71c61a0bef13c
|
refs/heads/helium
| 2023-08-17T03:13:54.729494
| 2023-08-16T23:24:18
| 2023-08-16T23:24:18
| 31,917,712
| 684
| 331
| null | 2023-07-25T21:19:08
| 2015-03-09T19:18:35
|
C
|
UTF-8
|
C
| false
| false
| 44,331
|
c
|
aries_margin.c
|
/*
* Copyright 2020 Astera Labs, Inc. or its affiliates. All Rights Reserved.
*
* 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
*
* or in the "license" file accompanying this file. This file 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.
*/
/**
* @file aries_margin.c
* @brief Implementation of receiver margining functions for the SDK.
*/
#include "include/aries_margin.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* noCommand does nothing
*/
AriesErrorType ariesMarginNoCommand(AriesRxMarginType* marginDevice)
{
ASTERA_WARN("Sending this out of band doesn't do anything");
return ARIES_SUCCESS;
}
/*
* Not implemented
*/
AriesErrorType ariesMarginAccessRetimerRegister(AriesRxMarginType* marginDevice)
{
ASTERA_WARN("Register access is not implemented yet");
return ARIES_SUCCESS;
}
/*
* Report margin control capabilities
*/
AriesErrorType
ariesMarginReportMarginControlCapabilities(AriesRxMarginType* marginDevice,
int* capabilities)
{
ASTERA_INFO("Reporting Margin Control Capabilities:");
ASTERA_INFO(" M_VOLTAGE_SUPPORTED = %d", VOLTAGESUPPORTED);
ASTERA_INFO(" M_IND_UP_DOWN_VOLTAGE = %d", INDUPDOWNVOLTAGE);
ASTERA_INFO(" M_IND_LEFT_RIGHT_TIMING = %d", INDLEFTRIGHTTIMING);
ASTERA_INFO(" M_SAMPLE_REPORTING_METHOD = %d", SAMPLEREPORTINGMETHOD);
ASTERA_INFO(" M_IND_ERROR_SAMPLER = %d", INDERRORSAMPLER);
capabilities[0] = VOLTAGESUPPORTED;
capabilities[1] = INDUPDOWNVOLTAGE;
capabilities[2] = INDLEFTRIGHTTIMING;
capabilities[3] = SAMPLEREPORTINGMETHOD;
capabilities[4] = INDERRORSAMPLER;
return ARIES_SUCCESS;
}
/*
* Report number of voltage steps
*/
AriesErrorType ariesMarginReportNumVoltageSteps(AriesRxMarginType* marginDevice,
int* numVoltageSteps)
{
*numVoltageSteps = NUMVOLTAGESTEPS;
return ARIES_SUCCESS;
}
/*
* Report number of timing steps
*/
AriesErrorType ariesMarginReportNumTimingSteps(AriesRxMarginType* marginDevice,
int* numTimingSteps)
{
*numTimingSteps = NUMTIMINGSTEPS;
return ARIES_SUCCESS;
}
/*
* Report max timing offset
*/
AriesErrorType ariesMarginReportMaxTimingOffset(AriesRxMarginType* marginDevice,
int* maxTimingOffset)
{
*maxTimingOffset = MAXTIMINGOFFSET;
return ARIES_SUCCESS;
}
/*
* Report max voltage offset
*/
AriesErrorType
ariesMarginReportMaxVoltageOffset(AriesRxMarginType* marginDevice,
int* maxVoltageOffset)
{
*maxVoltageOffset = MAXVOLTAGEOFFSET;
return ARIES_SUCCESS;
}
/*
* Report sampling rate voltage
*/
AriesErrorType
ariesMarginReportSamplingRateVoltage(AriesRxMarginType* marginDevice,
int* samplingRateVoltage)
{
*samplingRateVoltage = SAMPLINGRATEVOLTAGE;
return ARIES_SUCCESS;
}
/*
* Report sampling rate timing
*/
AriesErrorType
ariesMarginReportSamplingRateTiming(AriesRxMarginType* marginDevice,
int* samplingRateTiming)
{
*samplingRateTiming = NUMTIMINGSTEPS;
return ARIES_SUCCESS;
}
/*
* We do not use sample count
*/
AriesErrorType ariesMarginReportSampleCount(AriesRxMarginType* marginDevice)
{
ASTERA_WARN("We support sampling rates instead of sample count");
return ARIES_SUCCESS;
}
/*
* Report max lanes
*/
AriesErrorType ariesMarginReportMaxLanes(AriesRxMarginType* marginDevice,
int* maxLanes)
{
*maxLanes = MAXLANES;
return ARIES_SUCCESS;
}
/*
* Set the Error Count Limit
*/
AriesErrorType ariesMarginSetErrorCountLimit(AriesRxMarginType* marginDevice,
int limit)
{
if (limit > 63)
{
ASTERA_WARN(
"Error Count Limit cannot be greater than 63. Setting it to 63");
marginDevice->errorCountLimit = 63;
}
else
{
ASTERA_DEBUG("Error Count Limit is %d", limit);
marginDevice->errorCountLimit = limit;
}
return ARIES_SUCCESS;
}
/*
* Reset the phase and voltage offset and disable margining
*/
AriesErrorType ariesMarginGoToNormalSettings(AriesRxMarginType* marginDevice,
AriesPseudoPortType port, int lane)
{
AriesErrorType rc;
rc = ariesMarginPmaRxMarginStop(marginDevice, port, lane);
CHECK_SUCCESS(rc)
rc = ariesMarginClearErrorLog(marginDevice, port, lane);
CHECK_SUCCESS(rc)
return ARIES_SUCCESS;
}
/*
* Clears error count of a given port and lane
*/
AriesErrorType ariesMarginClearErrorLog(AriesRxMarginType* marginDevice,
AriesPseudoPortType port, int lane)
{
marginDevice->errorCount[port][lane] = 0;
return ARIES_SUCCESS;
}
/*
* Margin the device at a specified timing offset
*/
AriesErrorType ariesMarginStepMarginToTimingOffset(
AriesRxMarginType* marginDevice, AriesPseudoPortType port, int lane,
int direction, int steps, double dwell, int* eCount)
{
AriesErrorType rc;
if (direction != 0 && direction != 1)
{
ASTERA_ERROR("Unsupported direction argument, must be 1 or 0");
return ARIES_INVALID_ARGUMENT;
}
else if (steps > NUMTIMINGSTEPS)
{
ASTERA_ERROR(
"Unsupported Lane Margining command: Exceeded NumTimingSteps");
return ARIES_INVALID_ARGUMENT;
}
else
{
rc = ariesMarginPmaRxMarginTiming(marginDevice, port, lane, direction,
steps);
CHECK_SUCCESS(rc)
usleep((int)(dwell * 1000000));
rc = ariesMarginPmaRxMarginGetECount(marginDevice, port, lane);
CHECK_SUCCESS(rc)
if (marginDevice->do1XAnd0XCapture)
{
rc = ariesMarginPmaRxMarginTiming(marginDevice, port, lane,
direction, steps);
CHECK_SUCCESS(rc)
usleep((int)(dwell * 100000));
rc = ariesMarginPmaRxMarginGetECount(marginDevice, port, lane);
CHECK_SUCCESS(rc)
}
if (marginDevice->errorCount[port][lane] > 63)
{
marginDevice->errorCount[port][lane] = 63;
}
if (marginDevice->errorCount[port][lane] >
marginDevice->errorCountLimit)
{
ASTERA_DEBUG(
"Error count on port %d lane %d exceeded error count limit: %d > %d",
port, lane, marginDevice->errorCount[port][lane],
marginDevice->errorCountLimit);
*eCount = marginDevice->errorCount[port][lane];
ASTERA_DEBUG("Port %d lane %d is going back to default settings",
port, lane);
rc = ariesMarginGoToNormalSettings(marginDevice, port, lane);
CHECK_SUCCESS(rc)
return ARIES_SUCCESS;
}
else
{
ASTERA_DEBUG(
"Margining time is in progress on port %d lane %d. Current error count is: %d",
port, lane, marginDevice->errorCount[port][lane]);
*eCount = marginDevice->errorCount[port][lane];
return ARIES_SUCCESS;
}
}
}
/*
* Margin the device at a specified voltage offset
*/
AriesErrorType ariesMarginStepMarginToVoltageOffset(
AriesRxMarginType* marginDevice, AriesPseudoPortType port, int lane,
int direction, int steps, double dwell, int* eCount)
{
AriesErrorType rc;
if (direction != 0 && direction != 1)
{
ASTERA_ERROR("Unsupported direction argument, must be 0 or 1");
return ARIES_INVALID_ARGUMENT;
}
else if (steps > NUMVOLTAGESTEPS)
{
ASTERA_ERROR(
"Unsupported Lane Margining command: Exceeded NumTimingSteps");
return ARIES_INVALID_ARGUMENT;
}
else
{
rc = ariesMarginPmaRxMarginVoltage(marginDevice, port, lane, direction,
steps);
CHECK_SUCCESS(rc)
usleep((int)(dwell * 100000));
rc = ariesMarginPmaRxMarginGetECount(marginDevice, port, lane);
CHECK_SUCCESS(rc)
if (marginDevice->do1XAnd0XCapture)
{
direction = 1 - direction;
rc = ariesMarginPmaRxMarginVoltage(marginDevice, port, lane,
direction, steps);
CHECK_SUCCESS(rc)
usleep((int)(dwell * 100000));
rc = ariesMarginPmaRxMarginGetECount(marginDevice, port, lane);
CHECK_SUCCESS(rc)
}
if (marginDevice->errorCount[port][lane] > 63)
{
marginDevice->errorCount[port][lane] = 63;
}
if (marginDevice->errorCount[port][lane] >
marginDevice->errorCountLimit)
{
ASTERA_DEBUG(
"Error count on port %d lane %d exceeded error count limit: %d > %d",
port, lane, marginDevice->errorCount[port][lane],
marginDevice->errorCountLimit);
*eCount = marginDevice->errorCount[port][lane];
ASTERA_DEBUG("Port %d lane %d is going back to default settings",
port, lane);
rc = ariesMarginGoToNormalSettings(marginDevice, port, lane);
CHECK_SUCCESS(rc)
return ARIES_SUCCESS;
}
else
{
ASTERA_DEBUG(
"Margining voltage is in progress on port %d lane %d. Current error count is: %d",
port, lane, marginDevice->errorCount[port][lane]);
*eCount = marginDevice->errorCount[port][lane];
return ARIES_SUCCESS;
}
}
}
/*
* Not implemented
*/
AriesErrorType ariesMarginVendorDefined(AriesRxMarginType* marginDevice)
{
ASTERA_WARN("Vendor defined function is not implemented yet");
return ARIES_SUCCESS;
}
/*
* Tell the retimer we are finished margining
*/
AriesErrorType ariesMarginPmaRxMarginStop(AriesRxMarginType* marginDevice,
AriesPseudoPortType port, int lane)
{
AriesErrorType rc;
int side, quadSlice, quadSliceLane;
rc = ariesMarginDeterminePmaSideAndQs(marginDevice, port, lane, &side,
&quadSlice, &quadSliceLane);
CHECK_SUCCESS(rc)
uint8_t dataWord[2];
rc = ariesReadWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, dataWord);
CHECK_SUCCESS(rc)
uint8_t en = (dataWord[0] >> 1) & 0x1; // enable has offset of 1
if (en == 1)
{
// Setting OVRD enable to 0 for rx IQ
// Offset of 12, width of 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_7, 12, 0, 1);
CHECK_SUCCESS(rc)
// Setting OVRD enable to 0 for margin vdac
// Offset of 11, width of 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 11, 0, 1);
CHECK_SUCCESS(rc)
// Setting OVRD enable to 0 for margin in progress
// Offset of 13, width of 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 13, 0, 1);
CHECK_SUCCESS(rc)
rc = ariesMarginPmaRxReqAckHandshake(marginDevice, port, lane);
CHECK_SUCCESS(rc)
// Setting OVRD enable to 0 for margin error clear
// Offset of 1, width of 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 1, 0, 1);
CHECK_SUCCESS(rc)
}
return ARIES_SUCCESS;
}
/*
* Set margin timing sampler to a specified time value
*/
AriesErrorType ariesMarginPmaRxMarginTiming(AriesRxMarginType* marginDevice,
AriesPseudoPortType port, int lane,
int direction, int steps)
{
AriesErrorType rc;
// Determine pma side and qs from device port and lane
int side, quadSlice, quadSliceLane;
rc = ariesMarginDeterminePmaSideAndQs(marginDevice, port, lane, &side,
&quadSlice, &quadSliceLane);
CHECK_SUCCESS(rc)
// positive deltaValues move the slicer to the left
// assume the direction is left and if it is right we will overwrite
// deltaValue later
uint8_t deltaValue = steps;
// negative deltaValues move the slicer to the right
// if the direction is right, and we want to move at least 1 step then take
// the negation of our steps, so we move the opposite direction
if (direction == 1 && steps > 0) // right and not 0 steps
{
deltaValue = ((~steps + 1) & 0x7f);
}
// Setting IQ OVRD to 1 and setting the IQ value
// offset 12, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_7, 12, 1, 1);
CHECK_SUCCESS(rc)
// offset 5, width 7
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_7, 5, deltaValue, 7);
CHECK_SUCCESS(rc)
// set Rx margin error clear ovrd en to 1 and Rx margin error clear ovrd to
// 1 ALS-105: Stop a dummy req being generated by keeping Margin error clear
// high in case iq value is unchanged form last command offset 1, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 1, 1, 1);
CHECK_SUCCESS(rc)
// offset 0, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 0, 1, 1);
CHECK_SUCCESS(rc)
// set rxX margin in prog
// offset 13, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 13, 1, 1);
CHECK_SUCCESS(rc)
// offset 12, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 12, 1, 1);
CHECK_SUCCESS(rc)
rc = ariesMarginPmaRxReqAckHandshake(marginDevice, port, lane);
CHECK_SUCCESS(rc)
return ARIES_SUCCESS;
}
/*
* Set margin voltage sampler to a specified voltage
*/
AriesErrorType ariesMarginPmaRxMarginVoltage(AriesRxMarginType* marginDevice,
AriesPseudoPortType port, int lane,
int direction, int steps)
{
AriesErrorType rc;
// Determine pma side and qs from device port and lane
int side, quadSlice, quadSliceLane;
rc = ariesMarginDeterminePmaSideAndQs(marginDevice, port, lane, &side,
&quadSlice, &quadSliceLane);
CHECK_SUCCESS(rc)
// positive vdacValues move the slicer up
// assume the direction is up and if it is down we will overwrite deltaValue
// later
uint16_t vdacValue = steps;
// negative vdacValues move the slicer down
// if the direction is down, and we want to move at least 1 step then take
// the negation of our steps, so we move the opposite direction (aka down)
if (direction == 1 && steps > 0) // down or not 0 steps
{
vdacValue = ((~steps + 1) & 0x1ff);
}
// set VDAC override to 1 and set the VDAC value
// offset 11, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 11, 1, 1);
CHECK_SUCCESS(rc)
// offset 2, width 9
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 2, vdacValue, 9);
CHECK_SUCCESS(rc)
// set Rx margin error clear ovrd en to 1 and Rx margin error clear ovrd to
// 1 ALS-105: Stop a dummy req being generated by keeping Margin error clear
// high in case iq value is unchanged form last command offset 1, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 1, 1, 1);
CHECK_SUCCESS(rc)
// offset 0, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 0, 1, 1);
CHECK_SUCCESS(rc)
// set rxX margin in prog
// offset 13, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 13, 1, 1);
CHECK_SUCCESS(rc)
// offset 12, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 12, 1, 1);
CHECK_SUCCESS(rc)
rc = ariesMarginPmaRxReqAckHandshake(marginDevice, port, lane);
CHECK_SUCCESS(rc)
return ARIES_SUCCESS;
}
/*
* Set margin sampler to specified timing and voltage
*/
AriesErrorType ariesMarginPmaTimingVoltageOffset(
AriesRxMarginType* marginDevice, AriesPseudoPortType port, int lane,
int timeDirection, int timeSteps, int voltageDirection, int voltageSteps,
double dwell, int* eCount)
{
AriesErrorType rc;
// Determine pma side and qs from device port and lane
int side, quadSlice, quadSliceLane;
rc = ariesMarginDeterminePmaSideAndQs(marginDevice, port, lane, &side,
&quadSlice, &quadSliceLane);
CHECK_SUCCESS(rc)
// get the 1X eye capture
uint16_t deltaValue, vdacValue;
deltaValue = timeSteps;
vdacValue = voltageSteps;
if (timeDirection == 1 && timeSteps != 0)
{
deltaValue = ((~timeSteps + 1) & 0x7f);
}
if (voltageDirection == 1 && timeSteps != 0)
{
vdacValue = ((~voltageSteps + 1) & 0x1ff);
}
// set IQ override to 1 and set the IQ value
// offset 12, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_7, 12, 1, 1);
CHECK_SUCCESS(rc)
// offset 5, width 7
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_7, 5, deltaValue, 7);
CHECK_SUCCESS(rc)
// set VDAC override to 1 and set the VDAC value
// offset 11, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 11, 1, 1);
CHECK_SUCCESS(rc)
// offset 2, width 9
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 2, vdacValue, 9);
CHECK_SUCCESS(rc)
// set Rx margin error clear ovrd en to 1 and Rx margin error clear ovrd to
// 1 ALS-105: Stop a dummy req being generated by keeping Margin error clear
// high in case iq value is unchanged form last command offset 1, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 1, 1, 1);
CHECK_SUCCESS(rc)
// offset 0, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 0, 1, 1);
CHECK_SUCCESS(rc)
// set rxX margin in prog
// offset 13, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 13, 1, 1);
CHECK_SUCCESS(rc)
// offset 12, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 12, 1, 1);
CHECK_SUCCESS(rc)
rc = ariesMarginPmaRxReqAckHandshake(marginDevice, port, lane);
CHECK_SUCCESS(rc)
CHECK_SUCCESS(rc)
usleep((int)(dwell * 100000));
rc = ariesMarginPmaRxMarginGetECount(marginDevice, port, lane);
CHECK_SUCCESS(rc)
if (marginDevice->do1XAnd0XCapture)
{
voltageDirection = 1 - voltageDirection;
if (timeDirection == 1 && timeSteps != 0)
{
deltaValue = ((~timeSteps + 1) & 0x7f);
}
if (voltageDirection == 1 && timeSteps != 0)
{
vdacValue = ((~voltageSteps + 1) & 0x1ff);
}
// set IQ override to 1 and set the IQ value
// offset 12, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_7, 12, 1, 1);
CHECK_SUCCESS(rc)
// offset 5, with 7
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_7, 5, deltaValue, 7);
CHECK_SUCCESS(rc)
// set VDAC override to 1 and set the VDAC value
// offset 11, with 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 11, 1, 1);
CHECK_SUCCESS(rc)
// offset 2, width 9
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 2, vdacValue, 9);
CHECK_SUCCESS(rc)
// set Rx margin error clear ovrd en to 1 and Rx margin error clear ovrd
// to 1 ALS-105: Stop a dummy req being generated by keeping Margin
// error clear high in case iq value is unchanged form last command
// offset 1, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 1, 1, 1);
CHECK_SUCCESS(rc)
// offset 0, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 0, 1, 1);
CHECK_SUCCESS(rc)
// set rxX margin in prog
// offset 13, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 13, 1, 1);
CHECK_SUCCESS(rc)
// offset 12, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_OVRD_IN_9, 12, 1, 1);
CHECK_SUCCESS(rc)
rc = ariesMarginPmaRxReqAckHandshake(marginDevice, port, lane);
CHECK_SUCCESS(rc)
usleep((int)(dwell * 100000));
rc = ariesMarginPmaRxMarginGetECount(marginDevice, port, lane);
CHECK_SUCCESS(rc)
}
if (marginDevice->errorCount[port][lane] > 63)
marginDevice->errorCount[port][lane] = 63;
*eCount = marginDevice->errorCount[port][lane];
return ARIES_SUCCESS;
}
/*
* Updates the errorCount array with the number of errors that occurred in a
* given port and lane
*/
AriesErrorType ariesMarginPmaRxMarginGetECount(AriesRxMarginType* marginDevice,
AriesPseudoPortType port,
int lane)
{
// Determine pma side and quad slice
AriesErrorType rc;
int side, quadSlice, quadSliceLane;
rc = ariesMarginDeterminePmaSideAndQs(marginDevice, port, lane, &side,
&quadSlice, &quadSliceLane);
CHECK_SUCCESS(rc)
// Get error count from error count register
uint8_t dataWord[2];
rc = ariesReadWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_RX_CTL_RX_MARGIN_ERROR, dataWord);
CHECK_SUCCESS(rc)
uint8_t eCount =
dataWord[0] &
0x3f; // eCount is only 6 bits wide. We want the first 6 bits.
// update errorCount array
marginDevice->errorCount[port][lane] += eCount;
return ARIES_SUCCESS;
}
/*
* Send handshake for a port and lane
*/
AriesErrorType ariesMarginPmaRxReqAckHandshake(AriesRxMarginType* marginDevice,
AriesPseudoPortType port,
int lane)
{
AriesErrorType rc;
int side, quadSlice, quadSliceLane;
rc = ariesMarginDeterminePmaSideAndQs(marginDevice, port, lane, &side,
&quadSlice, &quadSliceLane);
CHECK_SUCCESS(rc)
// Assert rxX_req
// Force 0
// Offset 5, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_ATE_OVRD_IN, 5, 1, 1);
CHECK_SUCCESS(rc)
// Offset 4, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_ATE_OVRD_IN, 4, 0, 1);
CHECK_SUCCESS(rc)
// Force 1
// Offset 5, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_ATE_OVRD_IN, 5, 1, 1);
CHECK_SUCCESS(rc)
// Offset 4, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_ATE_OVRD_IN, 4, 1, 1);
CHECK_SUCCESS(rc)
// Check for ack
uint8_t dataWord[2];
uint8_t ack = 0x0;
int count = 0;
while (ack == 0)
{
rc = ariesReadWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_RX_PCS_OUT, dataWord);
ack = dataWord[0] & 0x1; // only care about first bit
CHECK_SUCCESS(rc)
count += 1;
if (count > 0x3fff)
{
ASTERA_ERROR("During Rx req handshake, ACK timed out");
break;
}
}
// Set rxX_req override to 0
// Offset 5, width 1
rc = ariesReadWriteWordPmaLaneMainMicroIndirect(
marginDevice->device->i2cDriver, side, quadSlice, quadSliceLane,
ARIES_PMA_RAWLANE_DIG_PCS_XF_ATE_OVRD_IN, 5, 0, 1);
CHECK_SUCCESS(rc)
return ARIES_SUCCESS;
}
/*
* Determine the PMA side and quadslice of a port and lane
*/
AriesErrorType ariesMarginDeterminePmaSideAndQs(AriesRxMarginType* marginDevice,
AriesPseudoPortType port,
int lane, int* side,
int* quadSlice,
int* quadSliceLane)
{
if (marginDevice->partNumber == ARIES_PTX16)
{
if (marginDevice->orientation ==
ARIES_ORIENTATION_NORMAL) // Normal Orientation
{
if (port == ARIES_UP_STREAM_PSEUDO_PORT) // USPP
{
*side = 1; // Side is a
}
else if (port == ARIES_DOWN_STREAM_PSEUDO_PORT) // DSPP
{
*side = 0; // Side is b
}
else
{
ASTERA_ERROR("Invalid port %d", port);
return ARIES_INVALID_ARGUMENT;
}
}
else if (marginDevice->orientation ==
ARIES_ORIENTATION_REVERSED) // Reversed Orientation
{
if (port == ARIES_UP_STREAM_PSEUDO_PORT) // USPP
{
*side = 0; // Side is b
}
else if (port == ARIES_DOWN_STREAM_PSEUDO_PORT) // DSPP
{
*side = 1; // Side is a
}
else
{
ASTERA_ERROR("Invalid port: %d", port);
return ARIES_INVALID_ARGUMENT;
}
}
else
{
ASTERA_ERROR("Invalid Orientation: %d", marginDevice->orientation);
return ARIES_INVALID_ARGUMENT;
}
*quadSlice = lane / 4;
}
else if (marginDevice->partNumber == ARIES_PTX08)
{
if (marginDevice->orientation ==
ARIES_ORIENTATION_NORMAL) // Normal Orientation
{
if (port == ARIES_UP_STREAM_PSEUDO_PORT) // USPP
{
*side = 0; // Side is b
}
else if (port == ARIES_DOWN_STREAM_PSEUDO_PORT) // DSPP
{
*side = 1; // Side is a
}
else
{
ASTERA_ERROR("Invalid port %d", port);
return ARIES_INVALID_ARGUMENT;
}
}
else if (marginDevice->orientation ==
ARIES_ORIENTATION_REVERSED) // Reversed Orientation
{
if (port == ARIES_UP_STREAM_PSEUDO_PORT) // USPP
{
*side = 1; // Side is a
}
else if (port == ARIES_DOWN_STREAM_PSEUDO_PORT) // DSPP
{
*side = 0; // Side is b
}
else
{
ASTERA_ERROR("Invalid port %d", port);
return ARIES_INVALID_ARGUMENT;
}
}
else
{
ASTERA_ERROR("Invalid Orientation: %d", marginDevice->orientation);
return ARIES_INVALID_ARGUMENT;
}
*quadSlice = lane / 4 + 1;
}
else
{
ASTERA_ERROR("Failed to match board Part Number: %d",
marginDevice->partNumber);
return ARIES_INVALID_ARGUMENT;
}
*quadSliceLane = lane % 4;
return ARIES_SUCCESS;
}
AriesErrorType ariesGetLaneRecoveryCount(AriesRxMarginType* marginDevice,
int lane, int* recoveryCount)
{
AriesErrorType rc;
AriesBifurcationType bifMode;
uint8_t byteVal[1];
int linkId;
int address;
// Get current bifurcation settings
rc = ariesGetBifurcationMode(marginDevice->device, &bifMode);
CHECK_SUCCESS(rc);
// Use bifurcation settings and lane to determine linkId
ariesGetLinkId(bifMode, lane, &linkId);
address = marginDevice->device->mm_print_info_struct_addr;
address += ARIES_PRINT_INFO_STRUCT_LNK_RECOV_ENTRIES_PTR_OFFSET + linkId;
// Read recovery count
rc = ariesReadByteDataMainMicroIndirect(marginDevice->device->i2cDriver,
address, byteVal);
CHECK_SUCCESS(rc);
*recoveryCount = byteVal[0];
return ARIES_SUCCESS;
}
/*
* determines eye height using binary search
*/
AriesErrorType ariesCheckEye(AriesRxMarginType* marginDevice,
AriesPseudoPortType port, int lane, double dwell,
double*** eyeResults)
{
AriesErrorType rc;
// get initial error count
int recovCount;
rc = ariesGetLaneRecoveryCount(marginDevice, lane, &recovCount);
CHECK_SUCCESS(rc);
ASTERA_INFO("Begining margining on lane %d", lane);
// timing
int i;
for (i = 0; i < 2; i++)
{ // 0:left, 1:right
rc = ariesMarginGoToNormalSettings(marginDevice, port, lane);
CHECK_SUCCESS(rc)
int low = 0;
int high = NUMTIMINGSTEPS;
int steps;
while (low != high)
{
steps = (low + high + 1) / 2;
rc = ariesMarginClearErrorLog(marginDevice, port, lane);
CHECK_SUCCESS(rc)
ASTERA_DEBUG("Checking timing offset direction %d steps %d", i,
steps);
int errorCount = 0;
rc = ariesMarginStepMarginToTimingOffset(
marginDevice, port, lane, i, steps, dwell, &errorCount);
CHECK_SUCCESS(rc)
if (errorCount > marginDevice->errorCountLimit)
{
// can't be here anymore. We saw too many errors here
high = steps - 1;
}
else
{
low = steps;
if (steps == NUMTIMINGSTEPS)
{
ASTERA_DEBUG(
"We reached maximum timing offset, exiting margining");
break;
}
}
}
eyeResults[port][lane][i] = low;
}
// voltage
for (i = 0; i < 2; i++)
{ // 0:up, 1:down
rc = ariesMarginGoToNormalSettings(marginDevice, port, lane);
CHECK_SUCCESS(rc)
int low = 0;
int high = NUMVOLTAGESTEPS;
int steps;
while (low != high)
{
steps = (low + high + 1) / 2;
rc = ariesMarginClearErrorLog(marginDevice, port, lane);
CHECK_SUCCESS(rc)
ASTERA_DEBUG("Checking voltage offset direction %d steps %d", i,
steps);
int errorCount = 0;
rc = ariesMarginStepMarginToVoltageOffset(
marginDevice, port, lane, i, steps, dwell, &errorCount);
CHECK_SUCCESS(rc)
if (errorCount > marginDevice->errorCountLimit)
{
// can't be here anymore. We saw too many errors here
high = steps - 1;
}
else
{
low = steps;
if (steps == NUMVOLTAGESTEPS)
{
ASTERA_DEBUG(
"We reached maximum voltage offset, exiting margining");
break;
}
}
}
eyeResults[port][lane][i + 2] = low;
}
// Check recovery count again. if they are different then a recovery
// happened
int recovCount2;
rc = ariesGetLaneRecoveryCount(marginDevice, lane, &recovCount2);
CHECK_SUCCESS(rc);
if (recovCount != recovCount2)
{
ASTERA_WARN("%d recoveries occured while margining this lane",
(recovCount2 - recovCount) / 2);
}
eyeResults[port][lane][4] = (recovCount2 - recovCount) / 2;
// Print results
double eyeWidthLeft = eyeResults[port][lane][0] / (double)NUMTIMINGSTEPS *
(double)MAXTIMINGOFFSET;
double eyeWidthRight = eyeResults[port][lane][1] / (double)NUMTIMINGSTEPS *
(double)MAXTIMINGOFFSET;
double eyeHeightUp = eyeResults[port][lane][2] / (double)NUMVOLTAGESTEPS *
(double)MAXVOLTAGEOFFSET;
double eyeHeightDown = eyeResults[port][lane][3] / (double)NUMVOLTAGESTEPS *
(double)MAXVOLTAGEOFFSET;
ASTERA_INFO("Eye stats for port %d lane %d", port, lane);
ASTERA_INFO(" Width = -%.2fUI to %.2fUI", eyeWidthLeft / 100.0,
eyeWidthRight / 100.0);
ASTERA_INFO(" Height = -%.0fmV to %.0fmV", eyeHeightDown * 10.0,
eyeHeightUp * 10.0);
return ARIES_SUCCESS;
}
/*
* logs eye results to a file
*/
AriesErrorType ariesLogEye(AriesRxMarginType* marginDevice,
AriesPseudoPortType port, int width,
const char* filename, int startLane, double dwell,
double*** eyeResults)
{
AriesErrorType rc;
if (width == 0)
{
if (marginDevice->partNumber == ARIES_PTX16)
{
width = 16;
}
else if (marginDevice->partNumber == ARIES_PTX08)
{
width = 8;
}
}
char filepath[ARIES_PATH_MAX];
snprintf(filepath, ARIES_PATH_MAX, "%s_%d.csv", filename, port);
FILE* fp;
fp = fopen(filepath, "w");
// Adding header
fprintf(
fp,
"Lane,Timing_neg_UI%%,Timing_pos_UI%%,Timing_tot_UI%%,Voltage_neg_mV,Voltage_pos_mV,Voltage_tot_mV,Recoveries\n");
int i;
for (i = startLane; i < startLane + width; i++)
{
rc = ariesCheckEye(marginDevice, port, i, dwell, eyeResults);
CHECK_SUCCESS(rc)
double eyeWidthLeft = eyeResults[port][i][0] / (double)NUMTIMINGSTEPS *
(double)MAXTIMINGOFFSET;
double eyeWidthRight = eyeResults[port][i][1] / (double)NUMTIMINGSTEPS *
(double)MAXTIMINGOFFSET;
double eyeHeightUp = eyeResults[port][i][2] / (double)NUMVOLTAGESTEPS *
(double)MAXVOLTAGEOFFSET;
double eyeHeightDown = eyeResults[port][i][3] /
(double)NUMVOLTAGESTEPS *
(double)MAXVOLTAGEOFFSET;
double recoveries = eyeResults[port][i][4];
fprintf(fp, "%d,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.0f\n", i, eyeWidthLeft,
eyeWidthRight, eyeWidthLeft + eyeWidthRight, eyeHeightDown * 10,
eyeHeightUp * 10, (eyeHeightUp + eyeHeightDown) * 10,
recoveries);
}
fclose(fp);
return ARIES_SUCCESS;
}
/*
* Determine eye by going step by step
*/
AriesErrorType ariesSweepEye(AriesRxMarginType* marginDevice,
AriesPseudoPortType port, int lane, double dwell,
double**** eyeResults)
{
AriesErrorType rc;
// get initial error count
int recovCount;
rc = ariesGetLaneRecoveryCount(marginDevice, lane, &recovCount);
CHECK_SUCCESS(rc);
ASTERA_INFO("Begining margining on lane %d", lane);
// timing
int i;
for (i = 0; i < 2; i++)
{
int steps;
for (steps = 0; steps <= NUMTIMINGSTEPS; steps++)
{
rc = ariesMarginClearErrorLog(marginDevice, port, lane);
CHECK_SUCCESS(rc)
ASTERA_DEBUG("Checking timing offset direction %d steps %d", i,
steps);
int errorCount = 0;
rc = ariesMarginStepMarginToTimingOffset(
marginDevice, port, lane, i, steps, dwell, &errorCount);
CHECK_SUCCESS(rc)
eyeResults[port][lane][i][steps] = errorCount;
}
}
// voltage
for (i = 0; i < 2; i++)
{
int steps;
for (steps = 0; steps <= NUMVOLTAGESTEPS; steps++)
{
rc = ariesMarginClearErrorLog(marginDevice, port, lane);
CHECK_SUCCESS(rc)
ASTERA_DEBUG("Checking voltage offset direction %d steps %d", i,
steps);
int errorCount = 0;
rc = ariesMarginStepMarginToVoltageOffset(
marginDevice, port, lane, i, steps, dwell, &errorCount);
CHECK_SUCCESS(rc)
eyeResults[port][lane][i + 2][steps] = errorCount;
}
}
// Check recovery count again. if they are different then a recovery
// happened
int recovCount2;
rc = ariesGetLaneRecoveryCount(marginDevice, lane, &recovCount2);
CHECK_SUCCESS(rc);
if (recovCount != recovCount2)
{
ASTERA_WARN("%d recoveries occured while margining this lane",
(recovCount2 - recovCount) / 2);
}
return ARIES_SUCCESS;
}
/*
* Create an eyeDiagram of the device on a specific port and lane
*/
AriesErrorType ariesEyeDiagram(AriesRxMarginType* marginDevice,
AriesPseudoPortType port, int lane, int rate,
double dwell, int**** eyeResults)
{
AriesErrorType rc;
int* timingOffsets = (int*)malloc(sizeof(int) * NUMTIMINGSTEPS + 1);
int voltageOffsets[] = {70, 60, 50, 40, 30, 20, 10, 0,
-10, -20, -30, -40, -50, -60, -70};
int i;
if (rate == 3)
{
for (i = 0; i < NUMTIMINGSTEPS + 1; i++)
{
timingOffsets[i] = (-NUMTIMINGSTEPS * 2) + (4 * i);
}
}
else if (rate >= 4 && rate < 6)
{
for (i = 0; i < NUMTIMINGSTEPS + 1; i++)
{
timingOffsets[i] = (-NUMTIMINGSTEPS) + (2 * i);
}
}
else
{
ASTERA_ERROR("%d is not a valid rate", rate);
return ARIES_INVALID_ARGUMENT;
}
char filepath[ARIES_PATH_MAX];
snprintf(filepath, ARIES_PATH_MAX, "eye_diagram_%d_lane%d.csv", port, lane);
// get initial error count
int recovCount;
rc = ariesGetLaneRecoveryCount(marginDevice, lane, &recovCount);
CHECK_SUCCESS(rc);
FILE* fp;
fp = fopen(filepath, "w");
int voltageOffset;
for (voltageOffset = 0; voltageOffset < 15; voltageOffset++)
{
fprintf(fp, "%3d,,", voltageOffsets[voltageOffset]);
for (i = 0; i < NUMTIMINGSTEPS + 1; i++)
{
rc = ariesMarginClearErrorLog(marginDevice, port, lane);
CHECK_SUCCESS(rc);
int errorCount = 0;
int timeDirection = 0;
if (timingOffsets[i] < 0)
{
timeDirection = 0; // left
}
else
{
timeDirection = 1; // right
}
int timeSteps = abs(timingOffsets[i]);
int voltageDirection = 0;
if (voltageOffsets[voltageOffset] < 0)
{
voltageDirection = 0;
}
else
{
voltageDirection = 1;
}
int voltageSteps = abs(voltageOffsets[voltageOffset]);
ASTERA_DEBUG("Checking offset x=%d,y=%d", timingOffsets[i],
voltageOffsets[voltageOffset]);
rc = ariesMarginPmaTimingVoltageOffset(
marginDevice, port, lane, timeDirection, timeSteps,
voltageDirection, voltageSteps, dwell, &errorCount);
CHECK_SUCCESS(rc)
eyeResults[port][lane][i][voltageOffset] = errorCount;
fprintf(fp, "%3d,", errorCount);
}
fprintf(fp, "\n");
}
fprintf(fp, "\n");
fprintf(fp, " ,,");
for (i = 0; i < NUMTIMINGSTEPS + 1; i++)
{
fprintf(fp, "%3d,", timingOffsets[i]);
}
fprintf(fp, "\n");
fclose(fp);
int recovCount2;
rc = ariesGetLaneRecoveryCount(marginDevice, lane, &recovCount2);
CHECK_SUCCESS(rc);
// Check recovery count again. if they are different then a recovery
// happened
if (recovCount != recovCount2)
{
ASTERA_WARN("%d recoveries occured while margining this lane",
(recovCount2 - recovCount) / 2);
}
return ARIES_SUCCESS;
}
#ifdef __cplusplus
}
#endif
|
39b2176fe95f6ccc04946000e9856a01bb3bec59
|
fb740802c87e9368500d7c344132d78b08915ed4
|
/src/runtime/async_queue.h
|
0ad3e8a2c4f6b893e21e45e087e2e63dec815781
|
[
"BSD-3-Clause"
] |
permissive
|
jrprice/Oclgrind
|
5a549f363f6df434e5e5bd8f6117ed4fcd3ddb15
|
accf518f8623548417c344a0193aa9b531cc9486
|
refs/heads/master
| 2023-08-01T02:57:26.601490
| 2022-09-29T11:29:13
| 2022-09-29T11:29:29
| 13,066,604
| 319
| 73
|
NOASSERTION
| 2022-09-04T16:36:52
| 2013-09-24T14:21:38
|
C++
|
UTF-8
|
C
| false
| false
| 739
|
h
|
async_queue.h
|
// async_queue.h (Oclgrind)
// Copyright (c) 2013-2019, James Price and Simon McIntosh-Smith,
// University of Bristol. All rights reserved.
//
// This program is provided under a three-clause BSD license. For full
// license terms please see the LICENSE file distributed with this
// source code.
#include "icd.h"
#include "core/Queue.h"
extern void asyncEnqueue(cl_command_queue queue, cl_command_type type,
oclgrind::Command* cmd, cl_uint numEvents,
const cl_event* waitList, cl_event* eventOut);
extern void asyncQueueRetain(oclgrind::Command* cmd, cl_mem mem);
extern void asyncQueueRetain(oclgrind::Command* cmd, cl_kernel);
extern void asyncQueueRelease(oclgrind::Command* cmd);
|
b578601f459591f1c612dd8a8cc258cfc8565c4c
|
46d7d222dc54c63228fd62bcac449b48cdaf9797
|
/butano/hw/3rd_party/libugba/include/ugba/sound.h
|
7432f63224029ab00e617e2e21e392c326404cfe
|
[
"LGPL-3.0-only",
"LGPL-2.0-or-later",
"MIT",
"Zlib",
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
GValiente/butano
|
020fff504c2c4cfde3395855c2b53525549bc3ff
|
2e39a999c3547f9f1a1839e1f89d3999f96b31f3
|
refs/heads/master
| 2023-08-30T15:05:46.091915
| 2023-08-30T03:42:21
| 2023-08-30T03:42:21
| 231,556,327
| 886
| 57
|
Zlib
| 2023-05-13T20:23:19
| 2020-01-03T09:35:05
|
C++
|
UTF-8
|
C
| false
| false
| 1,962
|
h
|
sound.h
|
// SPDX-License-Identifier: MIT
//
// Copyright (c) 2020-2021 Antonio Niño Díaz
#ifndef SOUND_H__
#define SOUND_H__
#include "definitions.h"
// Enable or disable sound hardware. It must be enabled before doing anything
// else with sound hardware.
EXPORT_API void SOUND_MasterEnable(int enable);
// Set volume of DMA channels. Valid values are 100 and 50. Any other value will
// be treated as 50%.
EXPORT_API void SOUND_DMA_Volume(int dma_a_max, int dma_b_max);
// Set master volume of all PSG channels. Valid values are 100, 50 and 25.. Any
// other value will be treated as 25%.
EXPORT_API void SOUND_PSG_MasterVolume(int volume);
// Set left and right volume of all PSG channels. Valid values are 0 to 7.
EXPORT_API void SOUND_PSG_Volume(int volume_left, int volume_right);
// Specify which DMA channels are heard from which speakers.
EXPORT_API
void SOUND_DMA_Pan(int dma_a_left, int dma_a_right,
int dma_b_left, int dma_b_right);
// Specify which PSG channels are heard from which speakers.
EXPORT_API
void SOUND_PSG_Pan(int left_1, int right_1, int left_2, int right_2,
int left_3, int right_3, int left_4, int right_4);
// Set buffer that will be streamed to DMA channel A. The buffer needs to be
// aligned to 32 bits.
EXPORT_API void SOUND_DMA_Stream_A(const void *source);
// Set buffer that will be streamed to DMA channel B. The buffer needs to be
// aligned to 32 bits.
EXPORT_API void SOUND_DMA_Stream_B(const void *source);
// Set buffers that will be streamed to DMA channels A and B. The buffers need
// to be aligned to 32 bits.
EXPORT_API void SOUND_DMA_Setup_AB(const void *source_a, const void *source_b);
// Restart DMA transfer used for audio.
EXPORT_API void SOUND_DMA_Retrigger_AB(void);
// Specify which timer is assigned to each one of the DMA channels. Only timers
// 0 and 1 are valid.
EXPORT_API void SOUND_DMA_TimerSetup(int dma_a_timer, int dma_b_timer);
#endif // SOUND_H__
|
7d5a164b32e94ac3bb2696e1f3e52d377c1930a5
|
5ff4b6986e6799bc0e143e060bafc14369030d8b
|
/toolchain/riscv-isa-sim/riscv/insns/vfcvt_f_x_v.h
|
c53b0e1fd62a6785592b0fcc07fc4678fec70c16
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"GPL-1.0-or-later",
"LLVM-exception",
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-bsd-3-clause-jtag",
"GPL-3.0-or-later"
] |
permissive
|
pulp-platform/mempool
|
7583204b2436cfc12ed95599463e51ad4df51557
|
c98fb3ada4f255623eaf9b09861f397a60c3d96b
|
refs/heads/main
| 2023-08-08T09:07:56.696580
| 2023-07-27T17:24:38
| 2023-07-27T17:24:38
| 223,218,149
| 178
| 28
|
Apache-2.0
| 2023-07-27T17:24:39
| 2019-11-21T16:34:37
|
C
|
UTF-8
|
C
| false
| false
| 274
|
h
|
vfcvt_f_x_v.h
|
// vfcvt.f.x.v vd, vd2, vm
VI_VFP_VF_LOOP
({
auto vs2_i = P.VU.elt<int16_t>(rs2_num, i);
vd = i32_to_f16(vs2_i);
},
{
auto vs2_i = P.VU.elt<int32_t>(rs2_num, i);
vd = i32_to_f32(vs2_i);
},
{
auto vs2_i = P.VU.elt<int64_t>(rs2_num, i);
vd = i64_to_f64(vs2_i);
})
|
dd30b60e8d076ab555b7af43693896b73d790ea2
|
6aa28590fa06dced46b5ec0d13b386719f5ffefa
|
/ncc/tests/regress_load.c
|
174e24466aa1ed4a5e131ece239ce4e0b4653167
|
[
"CC0-1.0",
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] |
permissive
|
maximecb/uvm
|
eb2e0e4a94cdf7c23677e3834e5c02a36f567602
|
b9496146fd999d371acd0835d4731f98cd5a87c3
|
refs/heads/main
| 2023-06-07T15:36:29.059838
| 2023-06-02T01:06:15
| 2023-06-02T01:06:15
| 502,388,309
| 318
| 11
|
Apache-2.0
| 2023-06-02T01:06:16
| 2022-06-11T15:39:49
|
Rust
|
UTF-8
|
C
| false
| false
| 282
|
c
|
regress_load.c
|
#include <assert.h>
u8 FRAME_BUFFER[1000];
char* CHAR_DOTS[128];
void main()
{
CHAR_DOTS[48] = "foo";
// Memset used to corrupt the memory used by CHAR_DOTS
asm (FRAME_BUFFER, 0, 1000) -> void { syscall memset; };
char* dots = CHAR_DOTS[48];
assert(dots);
}
|
fd0576e83fc1a52aa032437294a2406337e79bcc
|
9766fc3825aa95ab51e7973b643770084b164b2a
|
/blaze822_priv.h
|
e5f4a0970a7660c99d322499b5919f0d5ac0ad08
|
[
"LicenseRef-scancode-public-domain",
"CC0-1.0",
"MIT"
] |
permissive
|
leahneukirchen/mblaze
|
17285550274ba548373d5ca1defdbd7b649f4195
|
59ee2e0ab9f6721ffb6e0b686582d1d121b7a6cf
|
refs/heads/master
| 2023-09-01T22:05:05.107697
| 2023-07-31T19:12:38
| 2023-07-31T19:12:38
| 63,065,641
| 286
| 36
|
NOASSERTION
| 2023-07-31T18:17:46
| 2016-07-11T12:24:33
|
C
|
UTF-8
|
C
| false
| false
| 870
|
h
|
blaze822_priv.h
|
struct message {
char *msg;
char *end;
char *body;
char *bodyend;
char *bodychunk;
char *orig_header;
};
// WSP = SP / HTAB
#define iswsp(c) (((c) == ' ' || (c) == '\t'))
#define isfws(c) (((unsigned char)(c) == ' ' || (unsigned char)(c) == '\t' || (unsigned char)(c) == '\n' || (unsigned char)(c) == '\r'))
// 7bit-ASCII only lowercase/uppercase
#define lc(c) (((unsigned)(c)-'A') < 26 ? ((c) | 0x20) : (c))
#define uc(c) (((unsigned)(c)-'a') < 26 ? ((c) & 0xdf) : (c))
// dirent type that can be a mail/dir (following symlinks)
#if defined(DT_REG) && defined(DT_LNK) && defined(DT_UNKNOWN)
#define MAIL_DT(t) (t == DT_REG || t == DT_LNK || t == DT_UNKNOWN)
#define DIR_DT(t) (t == DT_DIR || t == DT_UNKNOWN)
#else
#define MAIL_DT(t) (1)
#define DIR_DT(t) (1)
#endif
void *mymemmem(const void *h0, size_t k, const void *n0, size_t l);
|
17bf74b07daee8d2238c051537e53299cc6656e4
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/arch/arc/arc/p_dti_tyne.c
|
0bbc9269b439ae3dbb3d18c5966fe0e80610d498
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 6,369
|
c
|
p_dti_tyne.c
|
/* $NetBSD: p_dti_tyne.c,v 1.20 2020/06/13 20:01:27 ad Exp $ */
/* $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department, The Mach Operating System project at
* Carnegie-Mellon University and Ralph Campbell.
*
* 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.
*
* from: @(#)machdep.c 8.3 (Berkeley) 1/12/94
*/
#define __INTR_PRIVATE
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: p_dti_tyne.c,v 1.20 2020/06/13 20:01:27 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/bus.h>
#include <sys/intr.h>
#include <uvm/uvm_extern.h>
#include <machine/autoconf.h>
#include <machine/pio.h>
#include <machine/platform.h>
#include <machine/wired_map.h>
#include <mips/pte.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
#include <dev/ic/i8042reg.h>
#include <arc/dti/desktech.h>
void arc_sysreset(bus_addr_t, bus_size_t);
#include "pc.h"
#if NPC_ISA > 0 || NOPMS_ISA > 0
#include <arc/dev/pcconsvar.h>
#include <arc/isa/pccons_isavar.h>
#endif
#include "btl.h"
#if NBTL > 0
#include <arc/dti/btlvar.h>
#endif
const char *p_dti_tyne_mainbusdevs[] = {
"tyneisabr",
NULL
};
void p_dti_tyne_init(void);
void p_dti_tyne_cons_init(void);
void p_dti_tyne_reset(void);
struct platform platform_desktech_tyne = {
"DESKTECH-TYNE",
"DESKTECH",
"",
"DeskStation Tyne",
"DESKTECH",
133, /* MHz */
p_dti_tyne_mainbusdevs,
platform_generic_match,
p_dti_tyne_init,
c_isa_cons_init,
p_dti_tyne_reset,
arc_set_intr,
};
/*
* This is a mask of bits to clear in the SR when we go to a
* given interrupt priority level.
*/
/* XXX see comments in p_dti_tyne_init() */
static const struct ipl_sr_map dti_tyne_ipl_sr_map = {
.sr_bits = {
[IPL_NONE] = 0,
[IPL_SOFTCLOCK] = MIPS_SOFT_INT_MASK_0,
[IPL_SOFTBIO] = MIPS_SOFT_INT_MASK_0,
[IPL_SOFTNET] = MIPS_SOFT_INT_MASK,
[IPL_SOFTSERIAL] = MIPS_SOFT_INT_MASK,
[IPL_VM] = MIPS_INT_MASK, /* XXX */
[IPL_SCHED] = MIPS_INT_MASK,
[IPL_DDB] = MIPS_INT_MASK,
[IPL_HIGH] = MIPS_INT_MASK,
},
};
#if NPC_ISA > 0 || NOPMS_ISA > 0
/*
* platform-dependent pccons configuration
*/
void pccons_dti_tyne_init(void);
struct pccons_config pccons_dti_tyne_conf = {
0x3b4, 0xb0000, /* mono: iobase, memaddr */
0x3d4, 0xb8000, /* cga: iobase, memaddr */
0x64, 0x60, /* kbdc: cmdport, dataport */
pccons_dti_tyne_init,
};
void
pccons_dti_tyne_init(void)
{
outb(arc_bus_io.bs_vbase + 0x3ce, 6); /* Correct video mode */
outb(arc_bus_io.bs_vbase + 0x3cf,
inb(arc_bus_io.bs_vbase + 0x3cf) | 0xc);
kbc_put8042cmd(CMDBYTE); /* Want XT codes.. */
}
#endif /* NPC_ISA > 0 || NOPMS_ISA > 0 */
#if NBTL > 0
/*
* platform-dependent btl configuration
*/
void btl_dti_tyne_bouncemem(u_int *, u_int *);
uint32_t btl_dti_tyne_kvtophys(uint32_t);
uint32_t btl_dti_tyne_phystokv(uint32_t);
struct btl_config btl_dti_tyne_conf = {
btl_dti_tyne_bouncemem,
btl_dti_tyne_kvtophys,
btl_dti_tyne_phystokv,
};
void
btl_dti_tyne_bouncemem(u_int *basep, u_int*sizep)
{
*basep = TYNE_V_BOUNCE;
*sizep = TYNE_S_BOUNCE;
}
uint32_t
btl_dti_tyne_kvtophys(uint32_t v)
{
return (v & 0x7fffff) | 0x800000;
}
uint32_t
btl_dti_tyne_phystokv(uint32_t p)
{
return (p & 0x7fffff) | TYNE_V_BOUNCE;
}
#endif /* NBTL > 0 */
/*
* critial i/o space, interrupt, and other chipset related initialization.
*/
void
p_dti_tyne_init(void)
{
/*
* Initialize interrupt priority
*/
/*
* XXX
* - rewrite spl handling to allow ISA clock > bio|tty|net
* or
* - use MIP3_INTERNAL_TIMER_INTERRUPT for clock
*/
ipl_sr_map = dti_tyne_ipl_sr_map;
/*
* Initialize I/O address offset
*/
arc_bus_space_init(&arc_bus_io, "tyneisaio",
TYNE_P_ISA_IO, TYNE_V_ISA_IO, 0, TYNE_S_ISA_IO);
arc_bus_space_init(&arc_bus_mem, "tyneisamem",
TYNE_P_ISA_MEM, TYNE_V_ISA_MEM, 0, TYNE_S_ISA_MEM);
/*
* Initialize wired TLB for I/O space which is used on early stage
*/
arc_init_wired_map();
arc_wired_enter_page(TYNE_V_BOUNCE, TYNE_P_BOUNCE,
MIPS3_PG_SIZE_MASK_TO_SIZE(MIPS3_PG_SIZE_256K));
arc_wired_enter_page(TYNE_V_ISA_IO, TYNE_P_ISA_IO, TYNE_S_ISA_IO);
arc_wired_enter_page(TYNE_V_ISA_MEM, TYNE_P_ISA_MEM, TYNE_S_ISA_MEM);
arc_wired_enter_page(0xe3000000, 0xfff00000,
MIPS3_PG_SIZE_MASK_TO_SIZE(MIPS3_PG_SIZE_4K));
/*
* common configuration for DTI platforms
*/
c_isa_init();
#if NPC_ISA > 0 || NOPMS_ISA > 0
/* platform-dependent pccons configuration */
pccons_isa_conf = &pccons_dti_tyne_conf;
#endif
#if NBTL > 0
/* platform-dependent btl configuration */
btl_conf = &btl_dti_tyne_conf;
#endif
}
void
p_dti_tyne_reset(void)
{
arc_sysreset(TYNE_V_ISA_IO + IO_KBD, KBCMDP);
}
|
001860c7daf1c2e009823762f299f03a09d9d50f
|
321d11eaee885ceb3a74db0a062f9bbdf282148c
|
/ssl/quic/quic_ackm.c
|
aa035da91268e528e02e62e99d6f85b1fb6ab2ad
|
[
"Apache-2.0",
"OpenSSL",
"LicenseRef-scancode-proprietary-license"
] |
permissive
|
openssl/openssl
|
75691ebaae957793f2ff0673f77545277dfb3988
|
5318c012885a5382eadbf95aa9c1d35664bca819
|
refs/heads/master
| 2023-09-03T15:22:52.727123
| 2023-09-01T07:10:49
| 2023-09-02T14:30:01
| 7,634,677
| 24,148
| 11,569
|
Apache-2.0
| 2023-09-14T19:48:11
| 2013-01-15T22:34:48
|
C
|
UTF-8
|
C
| false
| false
| 60,219
|
c
|
quic_ackm.c
|
/*
* Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include "internal/quic_ackm.h"
#include "internal/uint_set.h"
#include "internal/common.h"
#include <assert.h>
DEFINE_LIST_OF(tx_history, OSSL_ACKM_TX_PKT);
/*
* TX Packet History
* *****************
*
* The TX Packet History object tracks information about packets which have been
* sent for which we later expect to receive an ACK. It is essentially a simple
* database keeping a list of packet information structures in packet number
* order which can also be looked up directly by packet number.
*
* We currently only allow packets to be appended to the list (i.e. the packet
* numbers of the packets appended to the list must monotonically increase), as
* we should not currently need more general functionality such as a sorted list
* insert.
*/
struct tx_pkt_history_st {
/* A linked list of all our packets. */
OSSL_LIST(tx_history) packets;
/*
* Mapping from packet numbers (uint64_t) to (OSSL_ACKM_TX_PKT *)
*
* Invariant: A packet is in this map if and only if it is in the linked
* list.
*/
LHASH_OF(OSSL_ACKM_TX_PKT) *map;
/*
* The lowest packet number which may currently be added to the history list
* (inclusive). We do not allow packet numbers to be added to the history
* list non-monotonically, so packet numbers must be greater than or equal
* to this value.
*/
uint64_t watermark;
/*
* Packet number of the highest packet info structure we have yet appended
* to the list. This is usually one less than watermark, except when we have
* not added any packet yet.
*/
uint64_t highest_sent;
};
DEFINE_LHASH_OF_EX(OSSL_ACKM_TX_PKT);
static unsigned long tx_pkt_info_hash(const OSSL_ACKM_TX_PKT *pkt)
{
/* Using low bits of the packet number as the hash should be enough */
return (unsigned long)pkt->pkt_num;
}
static int tx_pkt_info_compare(const OSSL_ACKM_TX_PKT *a,
const OSSL_ACKM_TX_PKT *b)
{
if (a->pkt_num < b->pkt_num)
return -1;
if (a->pkt_num > b->pkt_num)
return 1;
return 0;
}
static int
tx_pkt_history_init(struct tx_pkt_history_st *h)
{
ossl_list_tx_history_init(&h->packets);
h->watermark = 0;
h->highest_sent = 0;
h->map = lh_OSSL_ACKM_TX_PKT_new(tx_pkt_info_hash, tx_pkt_info_compare);
if (h->map == NULL)
return 0;
return 1;
}
static void
tx_pkt_history_destroy(struct tx_pkt_history_st *h)
{
lh_OSSL_ACKM_TX_PKT_free(h->map);
h->map = NULL;
ossl_list_tx_history_init(&h->packets);
}
static int
tx_pkt_history_add_actual(struct tx_pkt_history_st *h,
OSSL_ACKM_TX_PKT *pkt)
{
OSSL_ACKM_TX_PKT *existing;
/*
* There should not be any existing packet with this number
* in our mapping.
*/
existing = lh_OSSL_ACKM_TX_PKT_retrieve(h->map, pkt);
if (!ossl_assert(existing == NULL))
return 0;
/* Should not already be in a list. */
if (!ossl_assert(ossl_list_tx_history_next(pkt) == NULL
&& ossl_list_tx_history_prev(pkt) == NULL))
return 0;
lh_OSSL_ACKM_TX_PKT_insert(h->map, pkt);
ossl_list_tx_history_insert_tail(&h->packets, pkt);
return 1;
}
/* Adds a packet information structure to the history list. */
static int
tx_pkt_history_add(struct tx_pkt_history_st *h,
OSSL_ACKM_TX_PKT *pkt)
{
if (!ossl_assert(pkt->pkt_num >= h->watermark))
return 0;
if (tx_pkt_history_add_actual(h, pkt) < 1)
return 0;
h->watermark = pkt->pkt_num + 1;
h->highest_sent = pkt->pkt_num;
return 1;
}
/* Retrieve a packet information structure by packet number. */
static OSSL_ACKM_TX_PKT *
tx_pkt_history_by_pkt_num(struct tx_pkt_history_st *h, uint64_t pkt_num)
{
OSSL_ACKM_TX_PKT key;
key.pkt_num = pkt_num;
return lh_OSSL_ACKM_TX_PKT_retrieve(h->map, &key);
}
/* Remove a packet information structure from the history log. */
static int
tx_pkt_history_remove(struct tx_pkt_history_st *h, uint64_t pkt_num)
{
OSSL_ACKM_TX_PKT key, *pkt;
key.pkt_num = pkt_num;
pkt = tx_pkt_history_by_pkt_num(h, pkt_num);
if (pkt == NULL)
return 0;
ossl_list_tx_history_remove(&h->packets, pkt);
lh_OSSL_ACKM_TX_PKT_delete(h->map, &key);
return 1;
}
/*
* RX Packet Number Tracking
* *************************
*
* **Background.** The RX side of the ACK manager must track packets we have
* received for which we have to generate ACK frames. Broadly, this means we
* store a set of packet numbers which we have received but which we do not know
* for a fact that the transmitter knows we have received.
*
* This must handle various situations:
*
* 1. We receive a packet but have not sent an ACK yet, so the transmitter
* does not know whether we have received it or not yet.
*
* 2. We receive a packet and send an ACK which is lost. We do not
* immediately know that the ACK was lost and the transmitter does not know
* that we have received the packet.
*
* 3. We receive a packet and send an ACK which is received by the
* transmitter. The transmitter does not immediately respond with an ACK,
* or responds with an ACK which is lost. The transmitter knows that we
* have received the packet, but we do not know for sure that it knows,
* because the ACK we sent could have been lost.
*
* 4. We receive a packet and send an ACK which is received by the
* transmitter. The transmitter subsequently sends us an ACK which confirms
* its receipt of the ACK we sent, and we successfully receive that ACK, so
* we know that the transmitter knows, that we received the original
* packet.
*
* Only when we reach case (4) are we relieved of any need to track a given
* packet number we have received, because only in this case do we know for sure
* that the peer knows we have received the packet. Having reached case (4) we
* will never again need to generate an ACK containing the PN in question, but
* until we reach that point, we must keep track of the PN as not having been
* provably ACKed, as we may have to keep generating ACKs for the given PN not
* just until the transmitter receives one, but until we know that it has
* received one. This will be referred to herein as "provably ACKed".
*
* **Duplicate handling.** The above discusses the case where we have received a
* packet with a given PN but are at best unsure whether the sender knows we
* have received it or not. However, we must also handle the case where we have
* yet to receive a packet with a given PN in the first place. The reason for
* this is because of the requirement expressed by RFC 9000 s. 12.3:
*
* "A receiver MUST discard a newly unprotected packet unless it is certain
* that it has not processed another packet with the same packet number from
* the same packet number space."
*
* We must ensure we never process a duplicate PN. As such, each possible PN we
* can receive must exist in one of the following logical states:
*
* - We have never processed this PN before
* (so if we receive such a PN, it can be processed)
*
* - We have processed this PN but it has not yet been provably ACKed
* (and should therefore be in any future ACK frame generated;
* if we receive such a PN again, it must be ignored)
*
* - We have processed this PN and it has been provably ACKed
* (if we receive such a PN again, it must be ignored)
*
* However, if we were to track this state for every PN ever used in the history
* of a connection, the amount of state required would increase unboundedly as
* the connection goes on (for example, we would have to store a set of every PN
* ever received.)
*
* RFC 9000 s. 12.3 continues:
*
* "Endpoints that track all individual packets for the purposes of detecting
* duplicates are at risk of accumulating excessive state. The data required
* for detecting duplicates can be limited by maintaining a minimum packet
* number below which all packets are immediately dropped."
*
* Moreover, RFC 9000 s. 13.2.3 states that:
*
* "A receiver MUST retain an ACK Range unless it can ensure that it will not
* subsequently accept packets with numbers in that range. Maintaining a
* minimum packet number that increases as ranges are discarded is one way to
* achieve this with minimal state."
*
* This touches on a subtlety of the original requirement quoted above: the
* receiver MUST discard a packet unless it is certain that it has not processed
* another packet with the same PN. However, this does not forbid the receiver
* from also discarding some PNs even though it has not yet processed them. In
* other words, implementations must be conservative and err in the direction of
* assuming a packet is a duplicate, but it is acceptable for this to come at
* the cost of falsely identifying some packets as duplicates.
*
* This allows us to bound the amount of state we must keep, and we adopt the
* suggested strategy quoted above to do so. We define a watermark PN below
* which all PNs are in the same state. This watermark is only ever increased.
* Thus the PNs the state for which needs to be explicitly tracked is limited to
* only a small number of recent PNs, and all older PNs have an assumed state.
*
* Any given PN thus falls into one of the following states:
*
* - (A) The PN is above the watermark but we have not yet received it.
*
* If we receive such a PN, we should process it and record the PN as
* received.
*
* - (B) The PN is above the watermark and we have received it.
*
* The PN should be included in any future ACK frame we generate.
* If we receive such a PN again, we should ignore it.
*
* - (C) The PN is below the watermark.
*
* We do not know whether a packet with the given PN was received or
* not. To be safe, if we receive such a packet, it is not processed.
*
* Note that state (C) corresponds to both "we have processed this PN and it has
* been provably ACKed" logical state and a subset of the PNs in the "we have
* never processed this PN before" logical state (namely all PNs which were lost
* and never received, but which are not recent enough to be above the
* watermark). The reason we can merge these states and avoid tracking states
* for the PNs in this state is because the provably ACKed and never-received
* states are functionally identical in terms of how we need to handle them: we
* don't need to do anything for PNs in either of these states, so we don't have
* to care about PNs in this state nor do we have to care about distinguishing
* the two states for a given PN.
*
* Note that under this scheme provably ACKed PNs are by definition always below
* the watermark; therefore, it follows that when a PN becomes provably ACKed,
* the watermark must be immediately increased to exceed it (otherwise we would
* keep reporting it in future ACK frames).
*
* This is in line with RFC 9000 s. 13.2.4's suggested strategy on when
* to advance the watermark:
*
* "When a packet containing an ACK frame is sent, the Largest Acknowledged
* field in that frame can be saved. When a packet containing an ACK frame is
* acknowledged, the receiver can stop acknowledging packets less than or
* equal to the Largest Acknowledged field in the sent ACK frame."
*
* This is where our scheme's false positives arise. When a packet containing an
* ACK frame is itself ACK'd, PNs referenced in that ACK frame become provably
* acked, and the watermark is bumped accordingly. However, the Largest
* Acknowledged field does not imply that all lower PNs have been received,
* because there may be gaps expressed in the ranges of PNs expressed by that
* and previous ACK frames. Thus, some unreceived PNs may be moved below the
* watermark, and we may subsequently reject those PNs as possibly being
* duplicates even though we have not actually received those PNs. Since we bump
* the watermark when a PN becomes provably ACKed, it follows that an unreceived
* PN falls below the watermark (and thus becomes a false positive for the
* purposes of duplicate detection) when a higher-numbered PN becomes provably
* ACKed.
*
* Thus, when PN n becomes provably acked, any unreceived PNs in the range [0,
* n) will no longer be processed. Although datagrams may be reordered in the
* network, a PN we receive can only become provably ACKed after our own
* subsequently generated ACK frame is sent in a future TX packet, and then we
* receive another RX PN acknowledging that TX packet. This means that a given RX
* PN can only become provably ACKed at least 1 RTT after it is received; it is
* unlikely that any reordered datagrams will still be "in the network" (and not
* lost) by this time. If this does occur for whatever reason and a late PN is
* received, the packet will be discarded unprocessed and the PN is simply
* handled as though lost (a "written off" PN).
*
* **Data structure.** Our state for the RX handling side of the ACK manager, as
* discussed above, mainly comprises:
*
* a) a logical set of PNs, and
* b) a monotonically increasing PN counter (the watermark).
*
* For (a), we define a data structure which stores a logical set of PNs, which
* we use to keep track of which PNs we have received but which have not yet
* been provably ACKed, and thus will later need to generate an ACK frame for.
*
* The correspondence with the logical states discussed above is as follows. A
* PN is in state (C) if it is below the watermark; otherwise it is in state (B)
* if it is in the logical set of PNs, and in state (A) otherwise.
*
* Note that PNs are only removed from the PN set (when they become provably
* ACKed or written off) by virtue of advancement of the watermark. Removing PNs
* from the PN set any other way would be ambiguous as it would be
* indistinguishable from a PN we have not yet received and risk us processing a
* duplicate packet. In other words, for a given PN:
*
* - State (A) can transition to state (B) or (C)
* - State (B) can transition to state (C) only
* - State (C) is the terminal state
*
* We can query the logical set data structure for PNs which have been received
* but which have not been provably ACKed when we want to generate ACK frames.
* Since ACK frames can be lost and/or we might not know that the peer has
* successfully received them, we might generate multiple ACK frames covering a
* given PN until that PN becomes provably ACKed and we finally remove it from
* our set (by bumping the watermark) as no longer being our concern.
*
* The data structure used is the UINT_SET structure defined in uint_set.h,
* which is used as a PN set. We use the following operations of the structure:
*
* Insert Range: Used when we receive a new PN.
*
* Remove Range: Used when bumping the watermark.
*
* Query: Used to determine if a PN is in the set.
*
* **Possible duplicates.** A PN is considered a possible duplicate when either:
*
* a) its PN is already in the PN set (i.e. has already been received), or
* b) its PN is below the watermark (i.e. was provably ACKed or written off).
*
* A packet with a given PN is considered 'processable' when that PN is not
* considered a possible duplicate (see ossl_ackm_is_rx_pn_processable).
*
* **TX/RX interaction.** The watermark is bumped whenever an RX packet becomes
* provably ACKed. This occurs when an ACK frame is received by the TX side of
* the ACK manager; thus, there is necessary interaction between the TX and RX
* sides of the ACK manager.
*
* This is implemented as follows. When a packet is queued as sent in the TX
* side of the ACK manager, it may optionally have a Largest Acked value set on
* it. The user of the ACK manager should do this if the packet being
* transmitted contains an ACK frame, by setting the field to the Largest Acked
* field of that frame. Otherwise, this field should be set to QUIC_PN_INVALID.
* When a TX packet is eventually acknowledged which has this field set, it is
* used to update the state of the RX side of the ACK manager by bumping the
* watermark accordingly.
*/
struct rx_pkt_history_st {
UINT_SET set;
/*
* Invariant: PNs below this are not in the set.
* Invariant: This is monotonic and only ever increases.
*/
QUIC_PN watermark;
};
static int rx_pkt_history_bump_watermark(struct rx_pkt_history_st *h,
QUIC_PN watermark);
static void rx_pkt_history_init(struct rx_pkt_history_st *h)
{
ossl_uint_set_init(&h->set);
h->watermark = 0;
}
static void rx_pkt_history_destroy(struct rx_pkt_history_st *h)
{
ossl_uint_set_destroy(&h->set);
}
/*
* Limit the number of ACK ranges we store to prevent resource consumption DoS
* attacks.
*/
#define MAX_RX_ACK_RANGES 32
static void rx_pkt_history_trim_range_count(struct rx_pkt_history_st *h)
{
QUIC_PN highest = QUIC_PN_INVALID;
while (ossl_list_uint_set_num(&h->set) > MAX_RX_ACK_RANGES) {
UINT_RANGE r = ossl_list_uint_set_head(&h->set)->range;
highest = (highest == QUIC_PN_INVALID)
? r.end : ossl_quic_pn_max(highest, r.end);
ossl_uint_set_remove(&h->set, &r);
}
/*
* Bump watermark to cover all PNs we removed to avoid accidental
* reprocessing of packets.
*/
if (highest != QUIC_PN_INVALID)
rx_pkt_history_bump_watermark(h, highest + 1);
}
static int rx_pkt_history_add_pn(struct rx_pkt_history_st *h,
QUIC_PN pn)
{
UINT_RANGE r;
r.start = pn;
r.end = pn;
if (pn < h->watermark)
return 1; /* consider this a success case */
if (ossl_uint_set_insert(&h->set, &r) != 1)
return 0;
rx_pkt_history_trim_range_count(h);
return 1;
}
static int rx_pkt_history_bump_watermark(struct rx_pkt_history_st *h,
QUIC_PN watermark)
{
UINT_RANGE r;
if (watermark <= h->watermark)
return 1;
/* Remove existing PNs below the watermark. */
r.start = 0;
r.end = watermark - 1;
if (ossl_uint_set_remove(&h->set, &r) != 1)
return 0;
h->watermark = watermark;
return 1;
}
/*
* ACK Manager Implementation
* **************************
* Implementation of the ACK manager proper.
*/
/* Constants used by the ACK manager; see RFC 9002. */
#define K_GRANULARITY (1 * OSSL_TIME_MS)
#define K_PKT_THRESHOLD 3
#define K_TIME_THRESHOLD_NUM 9
#define K_TIME_THRESHOLD_DEN 8
/* The maximum number of times we allow PTO to be doubled. */
#define MAX_PTO_COUNT 16
/* Default maximum amount of time to leave an ACK-eliciting packet un-ACK'd. */
#define DEFAULT_TX_MAX_ACK_DELAY ossl_ms2time(QUIC_DEFAULT_MAX_ACK_DELAY)
struct ossl_ackm_st {
/* Our list of transmitted packets. Corresponds to RFC 9002 sent_packets. */
struct tx_pkt_history_st tx_history[QUIC_PN_SPACE_NUM];
/* Our list of received PNs which are not yet provably acked. */
struct rx_pkt_history_st rx_history[QUIC_PN_SPACE_NUM];
/* Polymorphic dependencies that we consume. */
OSSL_TIME (*now)(void *arg);
void *now_arg;
OSSL_STATM *statm;
const OSSL_CC_METHOD *cc_method;
OSSL_CC_DATA *cc_data;
/* RFC 9002 variables. */
uint32_t pto_count;
QUIC_PN largest_acked_pkt[QUIC_PN_SPACE_NUM];
OSSL_TIME time_of_last_ack_eliciting_pkt[QUIC_PN_SPACE_NUM];
OSSL_TIME loss_time[QUIC_PN_SPACE_NUM];
OSSL_TIME loss_detection_deadline;
/* Lowest PN which is still not known to be ACKed. */
QUIC_PN lowest_unacked_pkt[QUIC_PN_SPACE_NUM];
/* Time at which we got our first RTT sample, or 0. */
OSSL_TIME first_rtt_sample;
/*
* A packet's num_bytes are added to this if it is inflight,
* and removed again once ack'd/lost/discarded.
*/
uint64_t bytes_in_flight;
/*
* A packet's num_bytes are added to this if it is both inflight and
* ack-eliciting, and removed again once ack'd/lost/discarded.
*/
uint64_t ack_eliciting_bytes_in_flight[QUIC_PN_SPACE_NUM];
/* Count of ECN-CE events. */
uint64_t peer_ecnce[QUIC_PN_SPACE_NUM];
/* Set to 1 when the handshake is confirmed. */
char handshake_confirmed;
/* Set to 1 when the peer has completed address validation. */
char peer_completed_addr_validation;
/* Set to 1 when a PN space has been discarded. */
char discarded[QUIC_PN_SPACE_NUM];
/* Set to 1 when we think an ACK frame should be generated. */
char rx_ack_desired[QUIC_PN_SPACE_NUM];
/* Set to 1 if an ACK frame has ever been generated. */
char rx_ack_generated[QUIC_PN_SPACE_NUM];
/* Probe request counts for reporting to the user. */
OSSL_ACKM_PROBE_INFO pending_probe;
/* Generated ACK frames for each PN space. */
OSSL_QUIC_FRAME_ACK ack[QUIC_PN_SPACE_NUM];
OSSL_QUIC_ACK_RANGE ack_ranges[QUIC_PN_SPACE_NUM][MAX_RX_ACK_RANGES];
/* Other RX state. */
/* Largest PN we have RX'd. */
QUIC_PN rx_largest_pn[QUIC_PN_SPACE_NUM];
/* Time at which the PN in rx_largest_pn was RX'd. */
OSSL_TIME rx_largest_time[QUIC_PN_SPACE_NUM];
/*
* ECN event counters. Each time we receive a packet with a given ECN label,
* the corresponding ECN counter here is incremented.
*/
uint64_t rx_ect0[QUIC_PN_SPACE_NUM];
uint64_t rx_ect1[QUIC_PN_SPACE_NUM];
uint64_t rx_ecnce[QUIC_PN_SPACE_NUM];
/*
* Number of ACK-eliciting packets since last ACK. We use this to defer
* emitting ACK frames until a threshold number of ACK-eliciting packets
* have been received.
*/
uint32_t rx_ack_eliciting_pkts_since_last_ack[QUIC_PN_SPACE_NUM];
/*
* The ACK frame coalescing deadline at which we should flush any unsent ACK
* frames.
*/
OSSL_TIME rx_ack_flush_deadline[QUIC_PN_SPACE_NUM];
/*
* The RX maximum ACK delay (the maximum amount of time our peer might
* wait to send us an ACK after receiving an ACK-eliciting packet).
*/
OSSL_TIME rx_max_ack_delay;
/*
* The TX maximum ACK delay (the maximum amount of time we allow ourselves
* to wait before generating an ACK after receiving an ACK-eliciting
* packet).
*/
OSSL_TIME tx_max_ack_delay;
/* Callbacks for deadline updates. */
void (*loss_detection_deadline_cb)(OSSL_TIME deadline, void *arg);
void *loss_detection_deadline_cb_arg;
void (*ack_deadline_cb)(OSSL_TIME deadline, int pkt_space, void *arg);
void *ack_deadline_cb_arg;
};
static ossl_inline uint32_t min_u32(uint32_t x, uint32_t y)
{
return x < y ? x : y;
}
/*
* Get TX history for a given packet number space. Must not have been
* discarded.
*/
static struct tx_pkt_history_st *get_tx_history(OSSL_ACKM *ackm, int pkt_space)
{
assert(!ackm->discarded[pkt_space]);
return &ackm->tx_history[pkt_space];
}
/*
* Get RX history for a given packet number space. Must not have been
* discarded.
*/
static struct rx_pkt_history_st *get_rx_history(OSSL_ACKM *ackm, int pkt_space)
{
assert(!ackm->discarded[pkt_space]);
return &ackm->rx_history[pkt_space];
}
/* Does the newly-acknowledged list contain any ack-eliciting packet? */
static int ack_includes_ack_eliciting(OSSL_ACKM_TX_PKT *pkt)
{
for (; pkt != NULL; pkt = pkt->anext)
if (pkt->is_ack_eliciting)
return 1;
return 0;
}
/* Return number of ACK-eliciting bytes in flight across all PN spaces. */
static uint64_t ackm_ack_eliciting_bytes_in_flight(OSSL_ACKM *ackm)
{
int i;
uint64_t total = 0;
for (i = 0; i < QUIC_PN_SPACE_NUM; ++i)
total += ackm->ack_eliciting_bytes_in_flight[i];
return total;
}
/* Return 1 if the range contains the given PN. */
static int range_contains(const OSSL_QUIC_ACK_RANGE *range, QUIC_PN pn)
{
return pn >= range->start && pn <= range->end;
}
/*
* Given a logical representation of an ACK frame 'ack', create a singly-linked
* list of the newly ACK'd frames; that is, of frames which are matched by the
* list of PN ranges contained in the ACK frame. The packet structures in the
* list returned are removed from the TX history list. Returns a pointer to the
* list head (or NULL) if empty.
*/
static OSSL_ACKM_TX_PKT *ackm_detect_and_remove_newly_acked_pkts(OSSL_ACKM *ackm,
const OSSL_QUIC_FRAME_ACK *ack,
int pkt_space)
{
OSSL_ACKM_TX_PKT *acked_pkts = NULL, **fixup = &acked_pkts, *pkt, *pprev;
struct tx_pkt_history_st *h;
size_t ridx = 0;
assert(ack->num_ack_ranges > 0);
/*
* Our history list is a list of packets sorted in ascending order
* by packet number.
*
* ack->ack_ranges is a list of packet number ranges in descending order.
*
* Walk through our history list from the end in order to efficiently detect
* membership in the specified ack ranges. As an optimization, we use our
* hashtable to try and skip to the first matching packet. This may fail if
* the ACK ranges given include nonexistent packets.
*/
h = get_tx_history(ackm, pkt_space);
pkt = tx_pkt_history_by_pkt_num(h, ack->ack_ranges[0].end);
if (pkt == NULL)
pkt = ossl_list_tx_history_tail(&h->packets);
for (; pkt != NULL; pkt = pprev) {
/*
* Save prev value as it will be zeroed if we remove the packet from the
* history list below.
*/
pprev = ossl_list_tx_history_prev(pkt);
for (;; ++ridx) {
if (ridx >= ack->num_ack_ranges) {
/*
* We have exhausted all ranges so stop here, even if there are
* more packets to look at.
*/
goto stop;
}
if (range_contains(&ack->ack_ranges[ridx], pkt->pkt_num)) {
/* We have matched this range. */
tx_pkt_history_remove(h, pkt->pkt_num);
*fixup = pkt;
fixup = &pkt->anext;
*fixup = NULL;
break;
} else if (pkt->pkt_num > ack->ack_ranges[ridx].end) {
/*
* We have not reached this range yet in our list, so do not
* advance ridx.
*/
break;
} else {
/*
* We have moved beyond this range, so advance to the next range
* and try matching again.
*/
assert(pkt->pkt_num < ack->ack_ranges[ridx].start);
continue;
}
}
}
stop:
return acked_pkts;
}
/*
* Create a singly-linked list of newly detected-lost packets in the given
* packet number space. Returns the head of the list or NULL if no packets were
* detected lost. The packets in the list are removed from the TX history list.
*/
static OSSL_ACKM_TX_PKT *ackm_detect_and_remove_lost_pkts(OSSL_ACKM *ackm,
int pkt_space)
{
OSSL_ACKM_TX_PKT *lost_pkts = NULL, **fixup = &lost_pkts, *pkt, *pnext;
OSSL_TIME loss_delay, lost_send_time, now;
OSSL_RTT_INFO rtt;
struct tx_pkt_history_st *h;
assert(ackm->largest_acked_pkt[pkt_space] != QUIC_PN_INVALID);
ossl_statm_get_rtt_info(ackm->statm, &rtt);
ackm->loss_time[pkt_space] = ossl_time_zero();
loss_delay = ossl_time_multiply(ossl_time_max(rtt.latest_rtt,
rtt.smoothed_rtt),
K_TIME_THRESHOLD_NUM);
loss_delay = ossl_time_divide(loss_delay, K_TIME_THRESHOLD_DEN);
/* Minimum time of K_GRANULARITY before packets are deemed lost. */
loss_delay = ossl_time_max(loss_delay, ossl_ticks2time(K_GRANULARITY));
/* Packets sent before this time are deemed lost. */
now = ackm->now(ackm->now_arg);
lost_send_time = ossl_time_subtract(now, loss_delay);
h = get_tx_history(ackm, pkt_space);
pkt = ossl_list_tx_history_head(&h->packets);
for (; pkt != NULL; pkt = pnext) {
assert(pkt_space == pkt->pkt_space);
/*
* Save prev value as it will be zeroed if we remove the packet from the
* history list below.
*/
pnext = ossl_list_tx_history_next(pkt);
if (pkt->pkt_num > ackm->largest_acked_pkt[pkt_space])
continue;
/*
* Mark packet as lost, or set time when it should be marked.
*/
if (ossl_time_compare(pkt->time, lost_send_time) <= 0
|| ackm->largest_acked_pkt[pkt_space]
>= pkt->pkt_num + K_PKT_THRESHOLD) {
tx_pkt_history_remove(h, pkt->pkt_num);
*fixup = pkt;
fixup = &pkt->lnext;
*fixup = NULL;
} else {
if (ossl_time_is_zero(ackm->loss_time[pkt_space]))
ackm->loss_time[pkt_space] =
ossl_time_add(pkt->time, loss_delay);
else
ackm->loss_time[pkt_space] =
ossl_time_min(ackm->loss_time[pkt_space],
ossl_time_add(pkt->time, loss_delay));
}
}
return lost_pkts;
}
static OSSL_TIME ackm_get_loss_time_and_space(OSSL_ACKM *ackm, int *pspace)
{
OSSL_TIME time = ackm->loss_time[QUIC_PN_SPACE_INITIAL];
int i, space = QUIC_PN_SPACE_INITIAL;
for (i = space + 1; i < QUIC_PN_SPACE_NUM; ++i)
if (ossl_time_is_zero(time)
|| ossl_time_compare(ackm->loss_time[i], time) == -1) {
time = ackm->loss_time[i];
space = i;
}
*pspace = space;
return time;
}
static OSSL_TIME ackm_get_pto_time_and_space(OSSL_ACKM *ackm, int *space)
{
OSSL_RTT_INFO rtt;
OSSL_TIME duration;
OSSL_TIME pto_timeout = ossl_time_infinite(), t;
int pto_space = QUIC_PN_SPACE_INITIAL, i;
ossl_statm_get_rtt_info(ackm->statm, &rtt);
duration
= ossl_time_add(rtt.smoothed_rtt,
ossl_time_max(ossl_time_multiply(rtt.rtt_variance, 4),
ossl_ticks2time(K_GRANULARITY)));
duration
= ossl_time_multiply(duration,
(uint64_t)1 << min_u32(ackm->pto_count,
MAX_PTO_COUNT));
/* Anti-deadlock PTO starts from the current time. */
if (ackm_ack_eliciting_bytes_in_flight(ackm) == 0) {
assert(!ackm->peer_completed_addr_validation);
*space = ackm->discarded[QUIC_PN_SPACE_INITIAL]
? QUIC_PN_SPACE_HANDSHAKE
: QUIC_PN_SPACE_INITIAL;
return ossl_time_add(ackm->now(ackm->now_arg), duration);
}
for (i = QUIC_PN_SPACE_INITIAL; i < QUIC_PN_SPACE_NUM; ++i) {
if (ackm->ack_eliciting_bytes_in_flight[i] == 0)
continue;
if (i == QUIC_PN_SPACE_APP) {
/* Skip application data until handshake confirmed. */
if (!ackm->handshake_confirmed)
break;
/* Include max_ack_delay and backoff for app data. */
if (!ossl_time_is_infinite(ackm->rx_max_ack_delay)) {
uint64_t factor
= (uint64_t)1 << min_u32(ackm->pto_count, MAX_PTO_COUNT);
duration
= ossl_time_add(duration,
ossl_time_multiply(ackm->rx_max_ack_delay,
factor));
}
}
t = ossl_time_add(ackm->time_of_last_ack_eliciting_pkt[i], duration);
if (ossl_time_compare(t, pto_timeout) < 0) {
pto_timeout = t;
pto_space = i;
}
}
*space = pto_space;
return pto_timeout;
}
static void ackm_set_loss_detection_timer_actual(OSSL_ACKM *ackm,
OSSL_TIME deadline)
{
ackm->loss_detection_deadline = deadline;
if (ackm->loss_detection_deadline_cb != NULL)
ackm->loss_detection_deadline_cb(deadline,
ackm->loss_detection_deadline_cb_arg);
}
static int ackm_set_loss_detection_timer(OSSL_ACKM *ackm)
{
int space;
OSSL_TIME earliest_loss_time, timeout;
earliest_loss_time = ackm_get_loss_time_and_space(ackm, &space);
if (!ossl_time_is_zero(earliest_loss_time)) {
/* Time threshold loss detection. */
ackm_set_loss_detection_timer_actual(ackm, earliest_loss_time);
return 1;
}
if (ackm_ack_eliciting_bytes_in_flight(ackm) == 0
&& ackm->peer_completed_addr_validation) {
/*
* Nothing to detect lost, so no timer is set. However, the client
* needs to arm the timer if the server might be blocked by the
* anti-amplification limit.
*/
ackm_set_loss_detection_timer_actual(ackm, ossl_time_zero());
return 1;
}
timeout = ackm_get_pto_time_and_space(ackm, &space);
ackm_set_loss_detection_timer_actual(ackm, timeout);
return 1;
}
static int ackm_in_persistent_congestion(OSSL_ACKM *ackm,
const OSSL_ACKM_TX_PKT *lpkt)
{
/* TODO(QUIC FUTURE): Persistent congestion not currently implemented. */
return 0;
}
static void ackm_on_pkts_lost(OSSL_ACKM *ackm, int pkt_space,
const OSSL_ACKM_TX_PKT *lpkt, int pseudo)
{
const OSSL_ACKM_TX_PKT *p, *pnext;
OSSL_RTT_INFO rtt;
QUIC_PN largest_pn_lost = 0;
OSSL_CC_LOSS_INFO loss_info = {0};
uint32_t flags = 0;
for (p = lpkt; p != NULL; p = pnext) {
pnext = p->lnext;
if (p->is_inflight) {
ackm->bytes_in_flight -= p->num_bytes;
if (p->is_ack_eliciting)
ackm->ack_eliciting_bytes_in_flight[p->pkt_space]
-= p->num_bytes;
if (p->pkt_num > largest_pn_lost)
largest_pn_lost = p->pkt_num;
if (!pseudo) {
/*
* If this is pseudo-loss (e.g. during connection retry) we do not
* inform the CC as it is not a real loss and not reflective of
* network conditions.
*/
loss_info.tx_time = p->time;
loss_info.tx_size = p->num_bytes;
ackm->cc_method->on_data_lost(ackm->cc_data, &loss_info);
}
}
p->on_lost(p->cb_arg);
}
/*
* Persistent congestion can only be considered if we have gotten at least
* one RTT sample.
*/
ossl_statm_get_rtt_info(ackm->statm, &rtt);
if (!ossl_time_is_zero(ackm->first_rtt_sample)
&& ackm_in_persistent_congestion(ackm, lpkt))
flags |= OSSL_CC_LOST_FLAG_PERSISTENT_CONGESTION;
ackm->cc_method->on_data_lost_finished(ackm->cc_data, flags);
}
static void ackm_on_pkts_acked(OSSL_ACKM *ackm, const OSSL_ACKM_TX_PKT *apkt)
{
const OSSL_ACKM_TX_PKT *anext;
QUIC_PN last_pn_acked = 0;
OSSL_CC_ACK_INFO ainfo = {0};
for (; apkt != NULL; apkt = anext) {
if (apkt->is_inflight) {
ackm->bytes_in_flight -= apkt->num_bytes;
if (apkt->is_ack_eliciting)
ackm->ack_eliciting_bytes_in_flight[apkt->pkt_space]
-= apkt->num_bytes;
if (apkt->pkt_num > last_pn_acked)
last_pn_acked = apkt->pkt_num;
if (apkt->largest_acked != QUIC_PN_INVALID)
/*
* This can fail, but it is monotonic; worst case we try again
* next time.
*/
rx_pkt_history_bump_watermark(get_rx_history(ackm,
apkt->pkt_space),
apkt->largest_acked + 1);
}
ainfo.tx_time = apkt->time;
ainfo.tx_size = apkt->num_bytes;
anext = apkt->anext;
apkt->on_acked(apkt->cb_arg); /* may free apkt */
if (apkt->is_inflight)
ackm->cc_method->on_data_acked(ackm->cc_data, &ainfo);
}
}
OSSL_ACKM *ossl_ackm_new(OSSL_TIME (*now)(void *arg),
void *now_arg,
OSSL_STATM *statm,
const OSSL_CC_METHOD *cc_method,
OSSL_CC_DATA *cc_data)
{
OSSL_ACKM *ackm;
int i;
ackm = OPENSSL_zalloc(sizeof(OSSL_ACKM));
if (ackm == NULL)
return NULL;
for (i = 0; i < (int)OSSL_NELEM(ackm->tx_history); ++i) {
ackm->largest_acked_pkt[i] = QUIC_PN_INVALID;
ackm->rx_ack_flush_deadline[i] = ossl_time_infinite();
if (tx_pkt_history_init(&ackm->tx_history[i]) < 1)
goto err;
}
for (i = 0; i < (int)OSSL_NELEM(ackm->rx_history); ++i)
rx_pkt_history_init(&ackm->rx_history[i]);
ackm->now = now;
ackm->now_arg = now_arg;
ackm->statm = statm;
ackm->cc_method = cc_method;
ackm->cc_data = cc_data;
ackm->rx_max_ack_delay = ossl_ms2time(QUIC_DEFAULT_MAX_ACK_DELAY);
ackm->tx_max_ack_delay = DEFAULT_TX_MAX_ACK_DELAY;
return ackm;
err:
while (--i >= 0)
tx_pkt_history_destroy(&ackm->tx_history[i]);
OPENSSL_free(ackm);
return NULL;
}
void ossl_ackm_free(OSSL_ACKM *ackm)
{
size_t i;
if (ackm == NULL)
return;
for (i = 0; i < OSSL_NELEM(ackm->tx_history); ++i)
if (!ackm->discarded[i]) {
tx_pkt_history_destroy(&ackm->tx_history[i]);
rx_pkt_history_destroy(&ackm->rx_history[i]);
}
OPENSSL_free(ackm);
}
int ossl_ackm_on_tx_packet(OSSL_ACKM *ackm, OSSL_ACKM_TX_PKT *pkt)
{
struct tx_pkt_history_st *h = get_tx_history(ackm, pkt->pkt_space);
/* Time must be set and not move backwards. */
if (ossl_time_is_zero(pkt->time)
|| ossl_time_compare(ackm->time_of_last_ack_eliciting_pkt[pkt->pkt_space],
pkt->time) > 0)
return 0;
/* Must have non-zero number of bytes. */
if (pkt->num_bytes == 0)
return 0;
/* Does not make any sense for a non-in-flight packet to be ACK-eliciting. */
if (!pkt->is_inflight && pkt->is_ack_eliciting)
return 0;
if (tx_pkt_history_add(h, pkt) == 0)
return 0;
if (pkt->is_inflight) {
if (pkt->is_ack_eliciting) {
ackm->time_of_last_ack_eliciting_pkt[pkt->pkt_space] = pkt->time;
ackm->ack_eliciting_bytes_in_flight[pkt->pkt_space]
+= pkt->num_bytes;
}
ackm->bytes_in_flight += pkt->num_bytes;
ackm_set_loss_detection_timer(ackm);
ackm->cc_method->on_data_sent(ackm->cc_data, pkt->num_bytes);
}
return 1;
}
int ossl_ackm_on_rx_datagram(OSSL_ACKM *ackm, size_t num_bytes)
{
/* No-op on the client. */
return 1;
}
static void ackm_process_ecn(OSSL_ACKM *ackm, const OSSL_QUIC_FRAME_ACK *ack,
int pkt_space)
{
struct tx_pkt_history_st *h;
OSSL_ACKM_TX_PKT *pkt;
OSSL_CC_ECN_INFO ecn_info = {0};
/*
* If the ECN-CE counter reported by the peer has increased, this could
* be a new congestion event.
*/
if (ack->ecnce > ackm->peer_ecnce[pkt_space]) {
ackm->peer_ecnce[pkt_space] = ack->ecnce;
h = get_tx_history(ackm, pkt_space);
pkt = tx_pkt_history_by_pkt_num(h, ack->ack_ranges[0].end);
if (pkt == NULL)
return;
ecn_info.largest_acked_time = pkt->time;
ackm->cc_method->on_ecn(ackm->cc_data, &ecn_info);
}
}
int ossl_ackm_on_rx_ack_frame(OSSL_ACKM *ackm, const OSSL_QUIC_FRAME_ACK *ack,
int pkt_space, OSSL_TIME rx_time)
{
OSSL_ACKM_TX_PKT *na_pkts, *lost_pkts;
int must_set_timer = 0;
if (ackm->largest_acked_pkt[pkt_space] == QUIC_PN_INVALID)
ackm->largest_acked_pkt[pkt_space] = ack->ack_ranges[0].end;
else
ackm->largest_acked_pkt[pkt_space]
= ossl_quic_pn_max(ackm->largest_acked_pkt[pkt_space],
ack->ack_ranges[0].end);
/*
* If we get an ACK in the handshake space, address validation is completed.
* Make sure we update the timer, even if no packets were ACK'd.
*/
if (!ackm->peer_completed_addr_validation
&& pkt_space == QUIC_PN_SPACE_HANDSHAKE) {
ackm->peer_completed_addr_validation = 1;
must_set_timer = 1;
}
/*
* Find packets that are newly acknowledged and remove them from the list.
*/
na_pkts = ackm_detect_and_remove_newly_acked_pkts(ackm, ack, pkt_space);
if (na_pkts == NULL) {
if (must_set_timer)
ackm_set_loss_detection_timer(ackm);
return 1;
}
/*
* Update the RTT if the largest acknowledged is newly acked and at least
* one ACK-eliciting packet was newly acked.
*
* First packet in the list is always the one with the largest PN.
*/
if (na_pkts->pkt_num == ack->ack_ranges[0].end &&
ack_includes_ack_eliciting(na_pkts)) {
OSSL_TIME now = ackm->now(ackm->now_arg), ack_delay;
if (ossl_time_is_zero(ackm->first_rtt_sample))
ackm->first_rtt_sample = now;
/* Enforce maximum ACK delay. */
ack_delay = ack->delay_time;
if (ackm->handshake_confirmed)
ack_delay = ossl_time_min(ack_delay, ackm->rx_max_ack_delay);
ossl_statm_update_rtt(ackm->statm, ack_delay,
ossl_time_subtract(now, na_pkts->time));
}
/*
* Process ECN information if present.
*
* We deliberately do most ECN processing in the ACKM rather than the
* congestion controller to avoid having to give the congestion controller
* access to ACKM internal state.
*/
if (ack->ecn_present)
ackm_process_ecn(ackm, ack, pkt_space);
/* Handle inferred loss. */
lost_pkts = ackm_detect_and_remove_lost_pkts(ackm, pkt_space);
if (lost_pkts != NULL)
ackm_on_pkts_lost(ackm, pkt_space, lost_pkts, /*pseudo=*/0);
ackm_on_pkts_acked(ackm, na_pkts);
/*
* Reset pto_count unless the client is unsure if the server validated the
* client's address.
*/
if (ackm->peer_completed_addr_validation)
ackm->pto_count = 0;
ackm_set_loss_detection_timer(ackm);
return 1;
}
int ossl_ackm_on_pkt_space_discarded(OSSL_ACKM *ackm, int pkt_space)
{
OSSL_ACKM_TX_PKT *pkt, *pnext;
uint64_t num_bytes_invalidated = 0;
if (ackm->discarded[pkt_space])
return 0;
if (pkt_space == QUIC_PN_SPACE_HANDSHAKE)
ackm->peer_completed_addr_validation = 1;
for (pkt = ossl_list_tx_history_head(&get_tx_history(ackm, pkt_space)->packets);
pkt != NULL; pkt = pnext) {
pnext = ossl_list_tx_history_next(pkt);
if (pkt->is_inflight) {
ackm->bytes_in_flight -= pkt->num_bytes;
num_bytes_invalidated += pkt->num_bytes;
}
pkt->on_discarded(pkt->cb_arg); /* may free pkt */
}
tx_pkt_history_destroy(&ackm->tx_history[pkt_space]);
rx_pkt_history_destroy(&ackm->rx_history[pkt_space]);
if (num_bytes_invalidated > 0)
ackm->cc_method->on_data_invalidated(ackm->cc_data,
num_bytes_invalidated);
ackm->time_of_last_ack_eliciting_pkt[pkt_space] = ossl_time_zero();
ackm->loss_time[pkt_space] = ossl_time_zero();
ackm->pto_count = 0;
ackm->discarded[pkt_space] = 1;
ackm->ack_eliciting_bytes_in_flight[pkt_space] = 0;
ackm_set_loss_detection_timer(ackm);
return 1;
}
int ossl_ackm_on_handshake_confirmed(OSSL_ACKM *ackm)
{
ackm->handshake_confirmed = 1;
ackm->peer_completed_addr_validation = 1;
ackm_set_loss_detection_timer(ackm);
return 1;
}
static void ackm_queue_probe_anti_deadlock_handshake(OSSL_ACKM *ackm)
{
++ackm->pending_probe.anti_deadlock_handshake;
}
static void ackm_queue_probe_anti_deadlock_initial(OSSL_ACKM *ackm)
{
++ackm->pending_probe.anti_deadlock_initial;
}
static void ackm_queue_probe(OSSL_ACKM *ackm, int pkt_space)
{
/*
* TODO(QUIC FUTURE): We are allowed to send either one or two probe
* packets here.
* Determine a strategy for when we should send two probe packets.
*/
++ackm->pending_probe.pto[pkt_space];
}
int ossl_ackm_on_timeout(OSSL_ACKM *ackm)
{
int pkt_space;
OSSL_TIME earliest_loss_time;
OSSL_ACKM_TX_PKT *lost_pkts;
earliest_loss_time = ackm_get_loss_time_and_space(ackm, &pkt_space);
if (!ossl_time_is_zero(earliest_loss_time)) {
/* Time threshold loss detection. */
lost_pkts = ackm_detect_and_remove_lost_pkts(ackm, pkt_space);
assert(lost_pkts != NULL);
ackm_on_pkts_lost(ackm, pkt_space, lost_pkts, /*pseudo=*/0);
ackm_set_loss_detection_timer(ackm);
return 1;
}
if (ackm_ack_eliciting_bytes_in_flight(ackm) == 0) {
assert(!ackm->peer_completed_addr_validation);
/*
* Client sends an anti-deadlock packet: Initial is padded to earn more
* anti-amplification credit. A handshake packet proves address
* ownership.
*/
if (ackm->discarded[QUIC_PN_SPACE_INITIAL])
ackm_queue_probe_anti_deadlock_handshake(ackm);
else
ackm_queue_probe_anti_deadlock_initial(ackm);
} else {
/*
* PTO. The user of the ACKM should send new data if available, else
* retransmit old data, or if neither is available, send a single PING
* frame.
*/
ackm_get_pto_time_and_space(ackm, &pkt_space);
ackm_queue_probe(ackm, pkt_space);
}
++ackm->pto_count;
ackm_set_loss_detection_timer(ackm);
return 1;
}
OSSL_TIME ossl_ackm_get_loss_detection_deadline(OSSL_ACKM *ackm)
{
return ackm->loss_detection_deadline;
}
OSSL_ACKM_PROBE_INFO *ossl_ackm_get0_probe_request(OSSL_ACKM *ackm)
{
return &ackm->pending_probe;
}
int ossl_ackm_get_largest_unacked(OSSL_ACKM *ackm, int pkt_space, QUIC_PN *pn)
{
struct tx_pkt_history_st *h;
OSSL_ACKM_TX_PKT *p;
h = get_tx_history(ackm, pkt_space);
p = ossl_list_tx_history_tail(&h->packets);
if (p != NULL) {
*pn = p->pkt_num;
return 1;
}
return 0;
}
/* Number of ACK-eliciting packets RX'd before we always emit an ACK. */
#define PKTS_BEFORE_ACK 2
/*
* Return 1 if emission of an ACK frame is currently desired.
*
* This occurs when one or more of the following conditions occurs:
*
* - We have flagged that we want to send an ACK frame
* (for example, due to the packet threshold count being exceeded), or
*
* - We have exceeded the ACK flush deadline, meaning that
* we have received at least one ACK-eliciting packet, but held off on
* sending an ACK frame immediately in the hope that more ACK-eliciting
* packets might come in, but not enough did and we are now requesting
* transmission of an ACK frame anyway.
*
*/
int ossl_ackm_is_ack_desired(OSSL_ACKM *ackm, int pkt_space)
{
return ackm->rx_ack_desired[pkt_space]
|| (!ossl_time_is_infinite(ackm->rx_ack_flush_deadline[pkt_space])
&& ossl_time_compare(ackm->now(ackm->now_arg),
ackm->rx_ack_flush_deadline[pkt_space]) >= 0);
}
/*
* Returns 1 if an ACK frame matches a given packet number.
*/
static int ack_contains(const OSSL_QUIC_FRAME_ACK *ack, QUIC_PN pkt_num)
{
size_t i;
for (i = 0; i < ack->num_ack_ranges; ++i)
if (range_contains(&ack->ack_ranges[i], pkt_num))
return 1;
return 0;
}
/*
* Returns 1 iff a PN (which we have just received) was previously reported as
* implied missing (by us, in an ACK frame we previously generated).
*/
static int ackm_is_missing(OSSL_ACKM *ackm, int pkt_space, QUIC_PN pkt_num)
{
/*
* A PN is implied missing if it is not greater than the highest PN in our
* generated ACK frame, but is not matched by the frame.
*/
return ackm->ack[pkt_space].num_ack_ranges > 0
&& pkt_num <= ackm->ack[pkt_space].ack_ranges[0].end
&& !ack_contains(&ackm->ack[pkt_space], pkt_num);
}
/*
* Returns 1 iff our RX of a PN newly establishes the implication of missing
* packets.
*/
static int ackm_has_newly_missing(OSSL_ACKM *ackm, int pkt_space)
{
struct rx_pkt_history_st *h;
h = get_rx_history(ackm, pkt_space);
if (ossl_list_uint_set_is_empty(&h->set))
return 0;
/*
* The second condition here establishes that the highest PN range in our RX
* history comprises only a single PN. If there is more than one, then this
* function will have returned 1 during a previous call to
* ossl_ackm_on_rx_packet assuming the third condition below was met. Thus
* we only return 1 when the missing PN condition is newly established.
*
* The third condition here establishes that the highest PN range in our RX
* history is beyond (and does not border) the highest PN we have yet
* reported in any ACK frame. Thus there is a gap of at least one PN between
* the PNs we have ACK'd previously and the PN we have just received.
*/
return ackm->ack[pkt_space].num_ack_ranges > 0
&& ossl_list_uint_set_tail(&h->set)->range.start
== ossl_list_uint_set_tail(&h->set)->range.end
&& ossl_list_uint_set_tail(&h->set)->range.start
> ackm->ack[pkt_space].ack_ranges[0].end + 1;
}
static void ackm_set_flush_deadline(OSSL_ACKM *ackm, int pkt_space,
OSSL_TIME deadline)
{
ackm->rx_ack_flush_deadline[pkt_space] = deadline;
if (ackm->ack_deadline_cb != NULL)
ackm->ack_deadline_cb(ossl_ackm_get_ack_deadline(ackm, pkt_space),
pkt_space, ackm->ack_deadline_cb_arg);
}
/* Explicitly flags that we want to generate an ACK frame. */
static void ackm_queue_ack(OSSL_ACKM *ackm, int pkt_space)
{
ackm->rx_ack_desired[pkt_space] = 1;
/* Cancel deadline. */
ackm_set_flush_deadline(ackm, pkt_space, ossl_time_infinite());
}
static void ackm_on_rx_ack_eliciting(OSSL_ACKM *ackm,
OSSL_TIME rx_time, int pkt_space,
int was_missing)
{
OSSL_TIME tx_max_ack_delay;
if (ackm->rx_ack_desired[pkt_space])
/* ACK generation already requested so nothing to do. */
return;
++ackm->rx_ack_eliciting_pkts_since_last_ack[pkt_space];
if (!ackm->rx_ack_generated[pkt_space]
|| was_missing
|| ackm->rx_ack_eliciting_pkts_since_last_ack[pkt_space]
>= PKTS_BEFORE_ACK
|| ackm_has_newly_missing(ackm, pkt_space)) {
/*
* Either:
*
* - We have never yet generated an ACK frame, meaning that this
* is the first ever packet received, which we should always
* acknowledge immediately, or
*
* - We previously reported the PN that we have just received as
* missing in a previous ACK frame (meaning that we should report
* the fact that we now have it to the peer immediately), or
*
* - We have exceeded the ACK-eliciting packet threshold count
* for the purposes of ACK coalescing, so request transmission
* of an ACK frame, or
*
* - The PN we just received and added to our PN RX history
* newly implies one or more missing PNs, in which case we should
* inform the peer by sending an ACK frame immediately.
*
* We do not test the ACK flush deadline here because it is tested
* separately in ossl_ackm_is_ack_desired.
*/
ackm_queue_ack(ackm, pkt_space);
return;
}
/*
* Not emitting an ACK yet.
*
* Update the ACK flush deadline.
*
* RFC 9000 s. 13.2.1: "An endpoint MUST acknowledge all ack-eliciting
* Initial and Handshake packets immediately"; don't delay ACK generation if
* we are using the Initial or Handshake PN spaces.
*/
tx_max_ack_delay = ackm->tx_max_ack_delay;
if (pkt_space == QUIC_PN_SPACE_INITIAL
|| pkt_space == QUIC_PN_SPACE_HANDSHAKE)
tx_max_ack_delay = ossl_time_zero();
if (ossl_time_is_infinite(ackm->rx_ack_flush_deadline[pkt_space]))
ackm_set_flush_deadline(ackm, pkt_space,
ossl_time_add(rx_time, tx_max_ack_delay));
else
ackm_set_flush_deadline(ackm, pkt_space,
ossl_time_min(ackm->rx_ack_flush_deadline[pkt_space],
ossl_time_add(rx_time,
tx_max_ack_delay)));
}
int ossl_ackm_on_rx_packet(OSSL_ACKM *ackm, const OSSL_ACKM_RX_PKT *pkt)
{
struct rx_pkt_history_st *h = get_rx_history(ackm, pkt->pkt_space);
int was_missing;
if (ossl_ackm_is_rx_pn_processable(ackm, pkt->pkt_num, pkt->pkt_space) != 1)
/* PN has already been processed or written off, no-op. */
return 1;
/*
* Record the largest PN we have RX'd and the time we received it.
* We use this to calculate the ACK delay field of ACK frames.
*/
if (pkt->pkt_num > ackm->rx_largest_pn[pkt->pkt_space]) {
ackm->rx_largest_pn[pkt->pkt_space] = pkt->pkt_num;
ackm->rx_largest_time[pkt->pkt_space] = pkt->time;
}
/*
* If the PN we just received was previously implied missing by virtue of
* being omitted from a previous ACK frame generated, we skip any packet
* count thresholds or coalescing delays and emit a new ACK frame
* immediately.
*/
was_missing = ackm_is_missing(ackm, pkt->pkt_space, pkt->pkt_num);
/*
* Add the packet number to our history list of PNs we have not yet provably
* acked.
*/
if (rx_pkt_history_add_pn(h, pkt->pkt_num) != 1)
return 0;
/*
* Receiving this packet may or may not cause us to emit an ACK frame.
* We may not emit an ACK frame yet if we have not yet received a threshold
* number of packets.
*/
if (pkt->is_ack_eliciting)
ackm_on_rx_ack_eliciting(ackm, pkt->time, pkt->pkt_space, was_missing);
/* Update the ECN counters according to which ECN signal we got, if any. */
switch (pkt->ecn) {
case OSSL_ACKM_ECN_ECT0:
++ackm->rx_ect0[pkt->pkt_space];
break;
case OSSL_ACKM_ECN_ECT1:
++ackm->rx_ect1[pkt->pkt_space];
break;
case OSSL_ACKM_ECN_ECNCE:
++ackm->rx_ecnce[pkt->pkt_space];
break;
default:
break;
}
return 1;
}
static void ackm_fill_rx_ack_ranges(OSSL_ACKM *ackm, int pkt_space,
OSSL_QUIC_FRAME_ACK *ack)
{
struct rx_pkt_history_st *h = get_rx_history(ackm, pkt_space);
UINT_SET_ITEM *x;
size_t i = 0;
/*
* Copy out ranges from the PN set, starting at the end, until we reach our
* maximum number of ranges.
*/
for (x = ossl_list_uint_set_tail(&h->set);
x != NULL && i < OSSL_NELEM(ackm->ack_ranges);
x = ossl_list_uint_set_prev(x), ++i) {
ackm->ack_ranges[pkt_space][i].start = x->range.start;
ackm->ack_ranges[pkt_space][i].end = x->range.end;
}
ack->ack_ranges = ackm->ack_ranges[pkt_space];
ack->num_ack_ranges = i;
}
const OSSL_QUIC_FRAME_ACK *ossl_ackm_get_ack_frame(OSSL_ACKM *ackm,
int pkt_space)
{
OSSL_QUIC_FRAME_ACK *ack = &ackm->ack[pkt_space];
OSSL_TIME now = ackm->now(ackm->now_arg);
ackm_fill_rx_ack_ranges(ackm, pkt_space, ack);
if (!ossl_time_is_zero(ackm->rx_largest_time[pkt_space])
&& ossl_time_compare(now, ackm->rx_largest_time[pkt_space]) > 0
&& pkt_space == QUIC_PN_SPACE_APP)
ack->delay_time =
ossl_time_subtract(now, ackm->rx_largest_time[pkt_space]);
else
ack->delay_time = ossl_time_zero();
ack->ect0 = ackm->rx_ect0[pkt_space];
ack->ect1 = ackm->rx_ect1[pkt_space];
ack->ecnce = ackm->rx_ecnce[pkt_space];
ack->ecn_present = 1;
ackm->rx_ack_eliciting_pkts_since_last_ack[pkt_space] = 0;
ackm->rx_ack_generated[pkt_space] = 1;
ackm->rx_ack_desired[pkt_space] = 0;
ackm_set_flush_deadline(ackm, pkt_space, ossl_time_infinite());
return ack;
}
OSSL_TIME ossl_ackm_get_ack_deadline(OSSL_ACKM *ackm, int pkt_space)
{
if (ackm->rx_ack_desired[pkt_space])
/* Already desired, deadline is now. */
return ossl_time_zero();
return ackm->rx_ack_flush_deadline[pkt_space];
}
int ossl_ackm_is_rx_pn_processable(OSSL_ACKM *ackm, QUIC_PN pn, int pkt_space)
{
struct rx_pkt_history_st *h = get_rx_history(ackm, pkt_space);
return pn >= h->watermark && ossl_uint_set_query(&h->set, pn) == 0;
}
void ossl_ackm_set_loss_detection_deadline_callback(OSSL_ACKM *ackm,
void (*fn)(OSSL_TIME deadline,
void *arg),
void *arg)
{
ackm->loss_detection_deadline_cb = fn;
ackm->loss_detection_deadline_cb_arg = arg;
}
void ossl_ackm_set_ack_deadline_callback(OSSL_ACKM *ackm,
void (*fn)(OSSL_TIME deadline,
int pkt_space,
void *arg),
void *arg)
{
ackm->ack_deadline_cb = fn;
ackm->ack_deadline_cb_arg = arg;
}
int ossl_ackm_mark_packet_pseudo_lost(OSSL_ACKM *ackm,
int pkt_space, QUIC_PN pn)
{
struct tx_pkt_history_st *h = get_tx_history(ackm, pkt_space);
OSSL_ACKM_TX_PKT *pkt;
pkt = tx_pkt_history_by_pkt_num(h, pn);
if (pkt == NULL)
return 0;
tx_pkt_history_remove(h, pkt->pkt_num);
pkt->lnext = NULL;
ackm_on_pkts_lost(ackm, pkt_space, pkt, /*pseudo=*/1);
return 1;
}
OSSL_TIME ossl_ackm_get_pto_duration(OSSL_ACKM *ackm)
{
OSSL_TIME duration;
OSSL_RTT_INFO rtt;
ossl_statm_get_rtt_info(ackm->statm, &rtt);
duration = ossl_time_add(rtt.smoothed_rtt,
ossl_time_max(ossl_time_multiply(rtt.rtt_variance, 4),
ossl_ticks2time(K_GRANULARITY)));
if (!ossl_time_is_infinite(ackm->rx_max_ack_delay))
duration = ossl_time_add(duration, ackm->rx_max_ack_delay);
return duration;
}
QUIC_PN ossl_ackm_get_largest_acked(OSSL_ACKM *ackm, int pkt_space)
{
return ackm->largest_acked_pkt[pkt_space];
}
void ossl_ackm_set_rx_max_ack_delay(OSSL_ACKM *ackm, OSSL_TIME rx_max_ack_delay)
{
ackm->rx_max_ack_delay = rx_max_ack_delay;
}
void ossl_ackm_set_tx_max_ack_delay(OSSL_ACKM *ackm, OSSL_TIME tx_max_ack_delay)
{
ackm->tx_max_ack_delay = tx_max_ack_delay;
}
|
b6d4b4905d5f2ee8300c160eeb9d233a290509b4
|
fdbb74a95924e2677466614f6ab6e2bb13b2a95a
|
/libc/runtime/getargmax.c
|
7792e50f93f7571d1a294eff7cc043ffe071ee1e
|
[
"ISC"
] |
permissive
|
jart/cosmopolitan
|
fb11b5658939023977060a7c6c71a74093d9cb44
|
0d748ad58e1063dd1f8560f18a0c75293b9415b7
|
refs/heads/master
| 2023-09-06T09:17:29.303607
| 2023-09-02T03:49:13
| 2023-09-02T03:50:18
| 272,457,606
| 11,887
| 435
|
ISC
| 2023-09-14T17:47:58
| 2020-06-15T14:16:13
|
C
|
UTF-8
|
C
| false
| false
| 3,570
|
c
|
getargmax.c
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
│ Copyright 2022 Justine Alexandra Roberts Tunney │
│ │
│ Permission to use, copy, modify, and/or distribute this software for │
│ any purpose with or without fee is hereby granted, provided that the │
│ above copyright notice and this permission notice appear in all copies. │
│ │
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 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 "libc/dce.h"
#include "libc/macros.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/limits.h"
#include "libc/sysv/consts/rlimit.h"
#define CTL_KERN 1
#define KERN_ARGMAX 8
/**
* Returns expensive but more correct version of `ARG_MAX`.
*/
int __get_arg_max(void) {
if (IsLinux()) {
// You might think that just returning a constant 128KiB (ARG_MAX)
// would make sense, as this guy did:
//
// https://lkml.org/lkml/2017/11/15/813...
//
// I suspect a 128kB sysconf(_SC_ARG_MAX) is the sanest bet, simply
// because of that "conservative is better than aggressive".
//
// Especially since _technically_ we're still limiting things to that
// 128kB due to the single-string limit.
//
// Linus
//
// In practice that caused us trouble with toybox tests for xargs
// edge cases. The tests assume that they can at least reach the
// kernel's "minimum maximum" of 128KiB, but if we report 128KiB for
// _SC_ARG_MAX and xargs starts subtracting the environment space
// and so on from that, then xargs will think it's run out of space
// when given 128KiB of data, which should always work. See this
// thread for more:
//
// http://lists.landley.net/pipermail/toybox-landley.net/2019-November/011229.html
//
// So let's resign ourselves to tracking what the kernel actually
// does. Right now (2019, Linux 5.3) that amounts to:
uint64_t stacksz;
stacksz = __get_rlimit(RLIMIT_STACK);
return MAX(MIN(stacksz / 4, 3 * (8 * 1024 * 1024) / 4), _ARG_MAX);
} else if (IsBsd()) {
return __get_sysctl(CTL_KERN, KERN_ARGMAX);
} else {
return _ARG_MAX;
}
}
|
2c5718e7886865e5db925c02b66adb94179c56d5
|
cb55c180ed2259447653d32886f0104824973f6c
|
/libs/module/avm_core.h
|
42cd490ecddaba4e12f37bbcb95d426146d3bc77
|
[
"MIT"
] |
permissive
|
avem-labs/Avem
|
45542576f7323cca85d77225399aa5a31771e970
|
9d3f6a4158cebba2aad9ef369662ca81835ac52b
|
refs/heads/develop
| 2023-06-16T11:12:27.527248
| 2018-01-28T11:59:46
| 2018-01-28T11:59:46
| 65,394,199
| 1,362
| 410
|
MIT
| 2023-07-03T10:13:36
| 2016-08-10T15:31:26
|
C
|
UTF-8
|
C
| false
| false
| 855
|
h
|
avm_core.h
|
#ifndef _AVM_CORE_H_
#define _AVM_CORE_H_
typedef struct avm_module_s avm_module_t;
// typedef struct avm_string_s avm_string_t;
#include <math.h>
#include <stm32f10x.h>
// #include <avm_string.h>
#include <avm_bit.h>
#include <avm_mpu6050.h>
#include <avm_motor.h>
#include <avm_uart.h>
#include <avm_wifi.h>
#include <avm_pid.h>
#include <avm_i2c.h>
#include <avm_tty.h>
struct avm_module_s {
unsigned short index;
unsigned int *confs;
unsigned char (*init_module)(void *arg);
unsigned char (*enable_module)(void);
unsigned char (*disable_module)(void);
};
extern avm_module_t *avm_modules_pool[];
extern avm_module_t avm_core_module_st;
void delay_ms(unsigned int t);
void delay_us(unsigned int t);
#define NVIC_GROUPING 3
// Jump to built-in bootloader
#define ISP_ADDR 0x1FFFF000
void jump2ISP();
#endif
|
fdc56eb00fcaf1fe266457d7d200e068ccf54bc8
|
376e1818d427b5e4d32fa6dd6c7b71e9fd88afdb
|
/audio/openal-soft/patches/patch-include_AL_al.h
|
e0638cc7771a5c64b6b641bd2b27e434570a9b0f
|
[] |
no_license
|
NetBSD/pkgsrc
|
a0732c023519650ef821ab89c23ab6ab59e25bdb
|
d042034ec4896cc5b47ed6f2e5b8802d9bc5c556
|
refs/heads/trunk
| 2023-09-01T07:40:12.138283
| 2023-09-01T05:25:19
| 2023-09-01T05:25:19
| 88,439,572
| 321
| 138
| null | 2023-07-12T22:34:14
| 2017-04-16T20:04:15
| null |
UTF-8
|
C
| false
| false
| 479
|
h
|
patch-include_AL_al.h
|
$NetBSD: patch-include_AL_al.h,v 1.2 2023/02/16 15:15:55 wiz Exp $
Fix SunOS build, int8_t is not always the same as signed char.
--- include/AL/al.h.orig 2023-02-03 14:48:18.000000000 +0000
+++ include/AL/al.h
@@ -41,7 +41,12 @@ typedef char ALboolean;
typedef char ALchar;
/** signed 8-bit integer */
+#ifdef __sun
+#include <inttypes.h>
+typedef int8_t ALbyte;
+#else
typedef signed char ALbyte;
+#endif
/** unsigned 8-bit integer */
typedef unsigned char ALubyte;
|
b3af0b8c65493dd20277699ab050b9a54808e555
|
7d7900e1c25b729fc8c208673a449c0520ba466e
|
/lib/CL/devices/vulkan/memfill64.h
|
9b2dc7642f8fd89b6869a426235a6a722de05eab
|
[
"MIT",
"BSD-2-Clause"
] |
permissive
|
pocl/pocl
|
384091e15c8f6abf29fd2c6deace34a7de5a6ac6
|
5a99e12d0bb78427ad948ac368589135507f1b59
|
refs/heads/main
| 2023-09-02T14:16:21.381680
| 2023-08-21T12:13:47
| 2023-08-21T12:13:47
| 12,292,999
| 775
| 250
|
MIT
| 2023-09-14T06:50:34
| 2013-08-22T09:26:12
|
C
|
UTF-8
|
C
| false
| false
| 9,166
|
h
|
memfill64.h
|
/* Autogenerated by hxtools bin2c */
#ifdef __cplusplus
extern "C" {
#endif
/* Autogenerated from memfill64.spv */
static const unsigned char bin2c_memfill64_spv[3480] = {03,02,'#',07,0,0,01,0,0,0,025,0,0201,0,0,0,0,0,0,0,021,0,02,0,01,0,0,0,012,0,013,0,'S','P','V','_','K','H','R','_','s','t','o','r','a','g','e','_','b','u','f','f','e','r','_','s','t','o','r','a','g','e','_','c','l','a','s','s',0,0,0,0,012,0,010,0,'S','P','V','_','K','H','R','_','n','o','n','_','s','e','m','a','n','t','i','c','_','i','n','f','o',0,0,0,013,0,012,0,'o',0,0,0,'N','o','n','S','e','m','a','n','t','i','c','.','C','l','s','p','v','R','e','f','l','e','c','t','i','o','n','.','1',0,0,0,016,0,03,0,0,0,0,0,01,0,0,0,017,0,07,0,05,0,0,0,025,0,0,0,'f','i','l','l','_','6','4','_','m','e','m',0,04,0,0,0,03,0,03,0,03,0,0,0,'x',0,0,0,07,0,05,0,'p',0,0,0,'f','i','l','l','_','6','4','_','m','e','m',0,07,0,03,0,'r',0,0,0,'m','e','m',0,07,0,04,0,'s',0,0,0,'u','i','n','t','*',0,0,0,07,0,04,0,'x',0,0,0,'p','a','t','t','e','r','n',0,07,0,05,0,'y',0,0,0,'p','a','t','t','e','r','n','6','4','_','t',0,'G',0,04,0,04,0,0,0,013,0,0,0,034,0,0,0,'G',0,04,0,010,0,0,0,013,0,0,0,031,0,0,0,'H',0,05,0,013,0,0,0,0,0,0,0,'#',0,0,0,0,0,0,0,'H',0,05,0,013,0,0,0,01,0,0,0,'#',0,0,0,04,0,0,0,'H',0,05,0,013,0,0,0,02,0,0,0,'#',0,0,0,010,0,0,0,'H',0,05,0,013,0,0,0,03,0,0,0,'#',0,0,0,014,0,0,0,'H',0,05,0,013,0,0,0,04,0,0,0,'#',0,0,0,020,0,0,0,'H',0,05,0,013,0,0,0,05,0,0,0,'#',0,0,0,024,0,0,0,'H',0,05,0,013,0,0,0,06,0,0,0,'#',0,0,0,030,0,0,0,'H',0,05,0,013,0,0,0,07,0,0,0,'#',0,0,0,034,0,0,0,'H',0,05,0,013,0,0,0,010,0,0,0,'#',0,0,0,' ',0,0,0,'H',0,05,0,013,0,0,0,011,0,0,0,'#',0,0,0,'$',0,0,0,'H',0,05,0,013,0,0,0,012,0,0,0,'#',0,0,0,'(',0,0,0,'H',0,05,0,013,0,0,0,013,0,0,0,'#',0,0,0,',',0,0,0,'H',0,05,0,013,0,0,0,014,0,0,0,'#',0,0,0,'0',0,0,0,'H',0,05,0,013,0,0,0,015,0,0,0,'#',0,0,0,'4',0,0,0,'H',0,05,0,013,0,0,0,016,0,0,0,'#',0,0,0,'8',0,0,0,'H',0,05,0,013,0,0,0,017,0,0,0,'#',0,0,0,'<',0,0,0,'H',0,05,0,014,0,0,0,0,0,0,0,'#',0,0,0,0,0,0,0,'H',0,05,0,014,0,0,0,01,0,0,0,'#',0,0,0,020,0,0,0,'G',0,03,0,014,0,0,0,02,0,0,0,'G',0,04,0,017,0,0,0,06,0,0,0,04,0,0,0,'H',0,05,0,020,0,0,0,0,0,0,0,'#',0,0,0,0,0,0,0,'G',0,03,0,020,0,0,0,02,0,0,0,'G',0,04,0,022,0,0,0,'"',0,0,0,0,0,0,0,'G',0,04,0,022,0,0,0,'!',0,0,0,0,0,0,0,'G',0,04,0,05,0,0,0,01,0,0,0,0,0,0,0,'G',0,04,0,06,0,0,0,01,0,0,0,01,0,0,0,'G',0,04,0,07,0,0,0,01,0,0,0,02,0,0,0,025,0,04,0,01,0,0,0,' ',0,0,0,0,0,0,0,027,0,04,0,02,0,0,0,01,0,0,0,03,0,0,0,' ',0,04,0,03,0,0,0,01,0,0,0,02,0,0,0,'2',0,04,0,01,0,0,0,05,0,0,0,01,0,0,0,'2',0,04,0,01,0,0,0,06,0,0,0,01,0,0,0,'2',0,04,0,01,0,0,0,07,0,0,0,01,0,0,0,'3',0,06,0,02,0,0,0,010,0,0,0,05,0,0,0,06,0,0,0,07,0,0,0,' ',0,04,0,011,0,0,0,06,0,0,0,02,0,0,0,036,0,022,0,013,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,01,0,0,0,036,0,04,0,014,0,0,0,02,0,0,0,013,0,0,0,' ',0,04,0,015,0,0,0,011,0,0,0,014,0,0,0,035,0,03,0,017,0,0,0,01,0,0,0,036,0,03,0,020,0,0,0,017,0,0,0,' ',0,04,0,021,0,0,0,014,0,0,0,020,0,0,0,023,0,02,0,023,0,0,0,'!',0,03,0,024,0,0,0,023,0,0,0,' ',0,04,0,027,0,0,0,011,0,0,0,01,0,0,0,'+',0,04,0,01,0,0,0,030,0,0,0,01,0,0,0,'+',0,04,0,01,0,0,0,031,0,0,0,0,0,0,0,'+',0,04,0,01,0,0,0,036,0,0,0,02,0,0,0,'+',0,04,0,01,0,0,0,'!',0,0,0,03,0,0,0,'+',0,04,0,01,0,0,0,'$',0,0,0,04,0,0,0,'+',0,04,0,01,0,0,0,047,0,0,0,05,0,0,0,'+',0,04,0,01,0,0,0,'*',0,0,0,06,0,0,0,'+',0,04,0,01,0,0,0,'-',0,0,0,07,0,0,0,'+',0,04,0,01,0,0,0,'0',0,0,0,010,0,0,0,'+',0,04,0,01,0,0,0,'3',0,0,0,011,0,0,0,'+',0,04,0,01,0,0,0,'6',0,0,0,012,0,0,0,'+',0,04,0,01,0,0,0,'9',0,0,0,013,0,0,0,'+',0,04,0,01,0,0,0,'<',0,0,0,014,0,0,0,'+',0,04,0,01,0,0,0,'?',0,0,0,015,0,0,0,'+',0,04,0,01,0,0,0,'B',0,0,0,016,0,0,0,'+',0,04,0,01,0,0,0,'E',0,0,0,017,0,0,0,' ',0,04,0,'H',0,0,0,01,0,0,0,01,0,0,0,' ',0,04,0,'O',0,0,0,014,0,0,0,01,0,0,0,'+',0,04,0,01,0,0,0,'t',0,0,0,0233,021,0,0,'+',0,04,0,01,0,0,0,'u',0,0,0,0243,021,0,0,'+',0,04,0,01,0,0,0,'z',0,0,0,0236,021,0,0,'+',0,04,0,01,0,0,0,'|',0,0,0,020,0,0,0,'+',0,04,0,01,0,0,0,'}',0,0,0,'@',0,0,0,';',0,04,0,03,0,0,0,04,0,0,0,01,0,0,0,';',0,05,0,011,0,0,0,012,0,0,0,06,0,0,0,010,0,0,0,';',0,04,0,015,0,0,0,016,0,0,0,011,0,0,0,';',0,04,0,021,0,0,0,022,0,0,0,014,0,0,0,'6',0,05,0,023,0,0,0,025,0,0,0,0,0,0,0,024,0,0,0,0370,0,02,0,026,0,0,0,'A',0,06,0,027,0,0,0,032,0,0,0,016,0,0,0,030,0,0,0,031,0,0,0,'=',0,04,0,01,0,0,0,033,0,0,0,032,0,0,0,'A',0,06,0,027,0,0,0,034,0,0,0,016,0,0,0,030,0,0,0,030,0,0,0,'=',0,04,0,01,0,0,0,035,0,0,0,034,0,0,0,'A',0,06,0,027,0,0,0,037,0,0,0,016,0,0,0,030,0,0,0,036,0,0,0,'=',0,04,0,01,0,0,0,' ',0,0,0,037,0,0,0,'A',0,06,0,027,0,0,0,'"',0,0,0,016,0,0,0,030,0,0,0,'!',0,0,0,'=',0,04,0,01,0,0,0,'#',0,0,0,'"',0,0,0,'A',0,06,0,027,0,0,0,'%',0,0,0,016,0,0,0,030,0,0,0,'$',0,0,0,'=',0,04,0,01,0,0,0,'&',0,0,0,'%',0,0,0,'A',0,06,0,027,0,0,0,'(',0,0,0,016,0,0,0,030,0,0,0,047,0,0,0,'=',0,04,0,01,0,0,0,')',0,0,0,'(',0,0,0,'A',0,06,0,027,0,0,0,'+',0,0,0,016,0,0,0,030,0,0,0,'*',0,0,0,'=',0,04,0,01,0,0,0,',',0,0,0,'+',0,0,0,'A',0,06,0,027,0,0,0,'.',0,0,0,016,0,0,0,030,0,0,0,'-',0,0,0,'=',0,04,0,01,0,0,0,'/',0,0,0,'.',0,0,0,'A',0,06,0,027,0,0,0,'1',0,0,0,016,0,0,0,030,0,0,0,'0',0,0,0,'=',0,04,0,01,0,0,0,'2',0,0,0,'1',0,0,0,'A',0,06,0,027,0,0,0,'4',0,0,0,016,0,0,0,030,0,0,0,'3',0,0,0,'=',0,04,0,01,0,0,0,'5',0,0,0,'4',0,0,0,'A',0,06,0,027,0,0,0,'7',0,0,0,016,0,0,0,030,0,0,0,'6',0,0,0,'=',0,04,0,01,0,0,0,'8',0,0,0,'7',0,0,0,'A',0,06,0,027,0,0,0,':',0,0,0,016,0,0,0,030,0,0,0,'9',0,0,0,'=',0,04,0,01,0,0,0,';',0,0,0,':',0,0,0,'A',0,06,0,027,0,0,0,'=',0,0,0,016,0,0,0,030,0,0,0,'<',0,0,0,'=',0,04,0,01,0,0,0,'>',0,0,0,'=',0,0,0,'A',0,06,0,027,0,0,0,'@',0,0,0,016,0,0,0,030,0,0,0,'?',0,0,0,'=',0,04,0,01,0,0,0,'A',0,0,0,'@',0,0,0,'A',0,06,0,027,0,0,0,'C',0,0,0,016,0,0,0,030,0,0,0,'B',0,0,0,'=',0,04,0,01,0,0,0,'D',0,0,0,'C',0,0,0,'A',0,06,0,027,0,0,0,'F',0,0,0,016,0,0,0,030,0,0,0,'E',0,0,0,'=',0,04,0,01,0,0,0,'G',0,0,0,'F',0,0,0,'A',0,05,0,'H',0,0,0,'I',0,0,0,04,0,0,0,031,0,0,0,'=',0,04,0,01,0,0,0,'J',0,0,0,'I',0,0,0,'A',0,06,0,027,0,0,0,'K',0,0,0,016,0,0,0,031,0,0,0,031,0,0,0,'=',0,04,0,01,0,0,0,'L',0,0,0,'K',0,0,0,0200,0,05,0,01,0,0,0,'M',0,0,0,'L',0,0,0,'J',0,0,0,0304,0,05,0,01,0,0,0,'N',0,0,0,'M',0,0,0,'$',0,0,0,'A',0,06,0,'O',0,0,0,'P',0,0,0,022,0,0,0,031,0,0,0,'N',0,0,0,'>',0,03,0,'P',0,0,0,033,0,0,0,0305,0,05,0,01,0,0,0,'Q',0,0,0,'N',0,0,0,030,0,0,0,'A',0,06,0,'O',0,0,0,'R',0,0,0,022,0,0,0,031,0,0,0,'Q',0,0,0,'>',0,03,0,'R',0,0,0,035,0,0,0,0305,0,05,0,01,0,0,0,'S',0,0,0,'N',0,0,0,036,0,0,0,'A',0,06,0,'O',0,0,0,'T',0,0,0,022,0,0,0,031,0,0,0,'S',0,0,0,'>',0,03,0,'T',0,0,0,' ',0,0,0,0305,0,05,0,01,0,0,0,'U',0,0,0,'N',0,0,0,'!',0,0,0,'A',0,06,0,'O',0,0,0,'V',0,0,0,022,0,0,0,031,0,0,0,'U',0,0,0,'>',0,03,0,'V',0,0,0,'#',0,0,0,0305,0,05,0,01,0,0,0,'W',0,0,0,'N',0,0,0,'$',0,0,0,'A',0,06,0,'O',0,0,0,'X',0,0,0,022,0,0,0,031,0,0,0,'W',0,0,0,'>',0,03,0,'X',0,0,0,'&',0,0,0,0305,0,05,0,01,0,0,0,'Y',0,0,0,'N',0,0,0,047,0,0,0,'A',0,06,0,'O',0,0,0,'Z',0,0,0,022,0,0,0,031,0,0,0,'Y',0,0,0,'>',0,03,0,'Z',0,0,0,')',0,0,0,0305,0,05,0,01,0,0,0,'[',0,0,0,'N',0,0,0,'*',0,0,0,'A',0,06,0,'O',0,0,0,0134,0,0,0,022,0,0,0,031,0,0,0,'[',0,0,0,'>',0,03,0,0134,0,0,0,',',0,0,0,0305,0,05,0,01,0,0,0,']',0,0,0,'N',0,0,0,'-',0,0,0,'A',0,06,0,'O',0,0,0,'^',0,0,0,022,0,0,0,031,0,0,0,']',0,0,0,'>',0,03,0,'^',0,0,0,'/',0,0,0,0305,0,05,0,01,0,0,0,'_',0,0,0,'N',0,0,0,'0',0,0,0,'A',0,06,0,'O',0,0,0,'`',0,0,0,022,0,0,0,031,0,0,0,'_',0,0,0,'>',0,03,0,'`',0,0,0,'2',0,0,0,0305,0,05,0,01,0,0,0,'a',0,0,0,'N',0,0,0,'3',0,0,0,'A',0,06,0,'O',0,0,0,'b',0,0,0,022,0,0,0,031,0,0,0,'a',0,0,0,'>',0,03,0,'b',0,0,0,'5',0,0,0,0305,0,05,0,01,0,0,0,'c',0,0,0,'N',0,0,0,'6',0,0,0,'A',0,06,0,'O',0,0,0,'d',0,0,0,022,0,0,0,031,0,0,0,'c',0,0,0,'>',0,03,0,'d',0,0,0,'8',0,0,0,0305,0,05,0,01,0,0,0,'e',0,0,0,'N',0,0,0,'9',0,0,0,'A',0,06,0,'O',0,0,0,'f',0,0,0,022,0,0,0,031,0,0,0,'e',0,0,0,'>',0,03,0,'f',0,0,0,';',0,0,0,0305,0,05,0,01,0,0,0,'g',0,0,0,'N',0,0,0,'<',0,0,0,'A',0,06,0,'O',0,0,0,'h',0,0,0,022,0,0,0,031,0,0,0,'g',0,0,0,'>',0,03,0,'h',0,0,0,'>',0,0,0,0305,0,05,0,01,0,0,0,'i',0,0,0,'N',0,0,0,'?',0,0,0,'A',0,06,0,'O',0,0,0,'j',0,0,0,022,0,0,0,031,0,0,0,'i',0,0,0,'>',0,03,0,'j',0,0,0,'A',0,0,0,0305,0,05,0,01,0,0,0,'k',0,0,0,'N',0,0,0,'B',0,0,0,'A',0,06,0,'O',0,0,0,'l',0,0,0,022,0,0,0,031,0,0,0,'k',0,0,0,'>',0,03,0,'l',0,0,0,'D',0,0,0,0305,0,05,0,01,0,0,0,'m',0,0,0,'N',0,0,0,'E',0,0,0,'A',0,06,0,'O',0,0,0,'n',0,0,0,022,0,0,0,031,0,0,0,'m',0,0,0,'>',0,03,0,'n',0,0,0,'G',0,0,0,0375,0,01,0,'8',0,01,0,014,0,07,0,023,0,0,0,0177,0,0,0,'o',0,0,0,017,0,0,0,031,0,0,0,'<',0,0,0,014,0,07,0,023,0,0,0,'q',0,0,0,'o',0,0,0,01,0,0,0,025,0,0,0,'p',0,0,0,014,0,012,0,023,0,0,0,'v',0,0,0,'o',0,0,0,02,0,0,0,'r',0,0,0,'s',0,0,0,'t',0,0,0,'u',0,0,0,031,0,0,0,014,0,012,0,023,0,0,0,'w',0,0,0,'o',0,0,0,03,0,0,0,'q',0,0,0,031,0,0,0,031,0,0,0,031,0,0,0,'v',0,0,0,014,0,012,0,023,0,0,0,'{',0,0,0,'o',0,0,0,02,0,0,0,'x',0,0,0,'y',0,0,0,'z',0,0,0,'u',0,0,0,031,0,0,0,014,0,012,0,023,0,0,0,'~',0,0,0,'o',0,0,0,07,0,0,0,'q',0,0,0,030,0,0,0,'|',0,0,0,'}',0,0,0,'{',0,0,0,014,0,010,0,023,0,0,0,0200,0,0,0,'o',0,0,0,014,0,0,0,031,0,0,0,030,0,0,0,036,0,0,0,};
#ifdef __cplusplus
} /* extern "C" */
#endif
|
12fd97cb0f3528e6a41ffe9986fad4f80036f3a0
|
35e28d7705773eed54345af4440700522c9d1863
|
/deps/libgdal/gdal/alg/gdal_crs.c
|
81a0ead8c0f9d8c87f4f93e1eb8e42f8eeeb643a
|
[
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"MIT",
"SunPro",
"LicenseRef-scancode-info-zip-2005-02",
"BSD-3-Clause"
] |
permissive
|
naturalatlas/node-gdal
|
0ee3447861bf2d1abc48d4fbdbcf15aba5473a27
|
c83e7858a9ec566cc91d65db74fd07b99789c0f0
|
refs/heads/master
| 2023-09-03T00:11:41.576937
| 2022-03-12T20:41:59
| 2022-03-12T20:41:59
| 19,504,824
| 522
| 122
|
Apache-2.0
| 2022-06-04T20:03:43
| 2014-05-06T18:02:34
|
C++
|
UTF-8
|
C
| false
| false
| 40,066
|
c
|
gdal_crs.c
|
/******************************************************************************
*
* Project: Mapinfo Image Warper
* Purpose: Implementation of the GDALTransformer wrapper around CRS.C functions
* to build a polynomial transformation based on ground control
* points.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
***************************************************************************
CRS.C - Center for Remote Sensing rectification routines
Written By: Brian J. Buckley
At: The Center for Remote Sensing
Michigan State University
302 Berkey Hall
East Lansing, MI 48824
(517)353-7195
Written: 12/19/91
Last Update: 12/26/91 Brian J. Buckley
Last Update: 1/24/92 Brian J. Buckley
Added printout of trnfile. Triggered by BDEBUG.
Last Update: 1/27/92 Brian J. Buckley
Fixed bug so that only the active control points were used.
Last Update: 6/29/2011 C. F. Stallmann & R. van den Dool (South African National Space Agency)
GCP refinement added
Copyright (c) 1992, Michigan State University
* Copyright (c) 2008-2013, Even Rouault <even dot rouault at mines-paris dot org>
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.
****************************************************************************/
#include "gdal_alg.h"
#include "cpl_conv.h"
#include "cpl_minixml.h"
#include "cpl_string.h"
#include "cpl_atomic_ops.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
CPL_CVSID("$Id: gdal_crs.c ee3197beea00209aedcf77e928b1e0c828251bd7 2018-10-01 23:39:49 +0200 Even Rouault $")
/* Hum, we cannot include gdal_priv.h from a .c file... */
CPL_C_START
void GDALSerializeGCPListToXML( CPLXMLNode* psParentNode,
GDAL_GCP* pasGCPList,
int nGCPCount,
const char* pszGCPProjection );
void GDALDeserializeGCPListFromXML( CPLXMLNode* psGCPList,
GDAL_GCP** ppasGCPList,
int* pnGCPCount,
char** ppszGCPProjection );
CPL_C_END
#define MAXORDER 3
struct Control_Points
{
int count;
double *e1;
double *n1;
double *e2;
double *n2;
int *status;
};
typedef struct
{
GDALTransformerInfo sTI;
double adfToGeoX[20];
double adfToGeoY[20];
double adfFromGeoX[20];
double adfFromGeoY[20];
double x1_mean;
double y1_mean;
double x2_mean;
double y2_mean;
int nOrder;
int bReversed;
int nGCPCount;
GDAL_GCP *pasGCPList;
int bRefine;
int nMinimumGcps;
double dfTolerance;
volatile int nRefCount;
} GCPTransformInfo;
CPL_C_START
CPLXMLNode *GDALSerializeGCPTransformer( void *pTransformArg );
void *GDALDeserializeGCPTransformer( CPLXMLNode *psTree );
CPL_C_END
/* crs.c */
static int CRS_georef(double, double, double *, double *,
double [], double [], int);
static int CRS_compute_georef_equations(GCPTransformInfo *psInfo, struct Control_Points *,
double [], double [], double [], double [], int);
static int remove_outliers(GCPTransformInfo *);
#define MSUCCESS 1 /* SUCCESS */
#define MNPTERR 0 /* NOT ENOUGH POINTS */
#define MUNSOLVABLE -1 /* NOT SOLVABLE */
#define MMEMERR -2 /* NOT ENOUGH MEMORY */
#define MPARMERR -3 /* PARAMETER ERROR */
#define MINTERR -4 /* INTERNAL ERROR */
static const char * const CRS_error_message[] = {
"Failed to compute GCP transform: Not enough points available",
"Failed to compute GCP transform: Transform is not solvable",
"Failed to compute GCP transform: Not enough memory",
"Failed to compute GCP transform: Parameter error",
"Failed to compute GCP transform: Internal error"
};
/************************************************************************/
/* GDALCreateSimilarGCPTransformer() */
/************************************************************************/
static
void* GDALCreateSimilarGCPTransformer( void *hTransformArg, double dfRatioX, double dfRatioY )
{
int i = 0;
GDAL_GCP *pasGCPList = NULL;
GCPTransformInfo *psInfo = (GCPTransformInfo *) hTransformArg;
VALIDATE_POINTER1( hTransformArg, "GDALCreateSimilarGCPTransformer", NULL );
if( dfRatioX == 1.0 && dfRatioY == 1.0 )
{
/* We can just use a ref count, since using the source transformation */
/* is thread-safe */
CPLAtomicInc(&(psInfo->nRefCount));
}
else
{
pasGCPList = GDALDuplicateGCPs( psInfo->nGCPCount, psInfo->pasGCPList );
for(i=0;i<psInfo->nGCPCount;i++)
{
pasGCPList[i].dfGCPPixel /= dfRatioX;
pasGCPList[i].dfGCPLine /= dfRatioY;
}
/* As remove_outliers modifies the provided GCPs we don't need to reapply it */
psInfo = (GCPTransformInfo *) GDALCreateGCPTransformer(
psInfo->nGCPCount, pasGCPList, psInfo->nOrder, psInfo->bReversed );
GDALDeinitGCPs( psInfo->nGCPCount, pasGCPList );
CPLFree( pasGCPList );
}
return psInfo;
}
/************************************************************************/
/* GDALCreateGCPTransformer() */
/************************************************************************/
static
void *GDALCreateGCPTransformerEx( int nGCPCount, const GDAL_GCP *pasGCPList,
int nReqOrder, int bReversed, int bRefine, double dfTolerance, int nMinimumGcps)
{
GCPTransformInfo *psInfo = NULL;
double *padfGeoX = NULL;
double *padfGeoY = NULL;
double *padfRasterX = NULL;
double *padfRasterY = NULL;
int *panStatus = NULL;
int iGCP = 0;
int nCRSresult = 0;
struct Control_Points sPoints;
double x1_sum = 0;
double y1_sum = 0;
double x2_sum = 0;
double y2_sum = 0;
memset( &sPoints, 0, sizeof(sPoints) );
if( nReqOrder == 0 )
{
if( nGCPCount >= 10 )
nReqOrder = 2; /*for now we avoid 3rd order since it is unstable*/
else if( nGCPCount >= 6 )
nReqOrder = 2;
else
nReqOrder = 1;
}
psInfo = (GCPTransformInfo *) CPLCalloc(sizeof(GCPTransformInfo),1);
psInfo->bReversed = bReversed;
psInfo->nOrder = nReqOrder;
psInfo->bRefine = bRefine;
psInfo->dfTolerance = dfTolerance;
psInfo->nMinimumGcps = nMinimumGcps;
psInfo->nRefCount = 1;
psInfo->pasGCPList = GDALDuplicateGCPs( nGCPCount, pasGCPList );
psInfo->nGCPCount = nGCPCount;
memcpy( psInfo->sTI.abySignature, GDAL_GTI2_SIGNATURE, strlen(GDAL_GTI2_SIGNATURE) );
psInfo->sTI.pszClassName = "GDALGCPTransformer";
psInfo->sTI.pfnTransform = GDALGCPTransform;
psInfo->sTI.pfnCleanup = GDALDestroyGCPTransformer;
psInfo->sTI.pfnSerialize = GDALSerializeGCPTransformer;
psInfo->sTI.pfnCreateSimilar = GDALCreateSimilarGCPTransformer;
/* -------------------------------------------------------------------- */
/* Compute the forward and reverse polynomials. */
/* -------------------------------------------------------------------- */
if( nGCPCount == 0 )
{
nCRSresult = MNPTERR;
}
else if(bRefine)
{
nCRSresult = remove_outliers(psInfo);
}
else
{
/* -------------------------------------------------------------------- */
/* Allocate and initialize the working points list. */
/* -------------------------------------------------------------------- */
padfGeoX = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfGeoY = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfRasterX = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfRasterY = (double *) CPLCalloc(sizeof(double),nGCPCount);
panStatus = (int *) CPLCalloc(sizeof(int),nGCPCount);
for( iGCP = 0; iGCP < nGCPCount; iGCP++ )
{
panStatus[iGCP] = 1;
padfGeoX[iGCP] = pasGCPList[iGCP].dfGCPX;
padfGeoY[iGCP] = pasGCPList[iGCP].dfGCPY;
padfRasterX[iGCP] = pasGCPList[iGCP].dfGCPPixel;
padfRasterY[iGCP] = pasGCPList[iGCP].dfGCPLine;
x1_sum += pasGCPList[iGCP].dfGCPPixel;
y1_sum += pasGCPList[iGCP].dfGCPLine;
x2_sum += pasGCPList[iGCP].dfGCPX;
y2_sum += pasGCPList[iGCP].dfGCPY;
}
psInfo->x1_mean = x1_sum / nGCPCount;
psInfo->y1_mean = y1_sum / nGCPCount;
psInfo->x2_mean = x2_sum / nGCPCount;
psInfo->y2_mean = y2_sum / nGCPCount;
sPoints.count = nGCPCount;
sPoints.e1 = padfRasterX;
sPoints.n1 = padfRasterY;
sPoints.e2 = padfGeoX;
sPoints.n2 = padfGeoY;
sPoints.status = panStatus;
nCRSresult = CRS_compute_georef_equations( psInfo, &sPoints,
psInfo->adfToGeoX, psInfo->adfToGeoY,
psInfo->adfFromGeoX, psInfo->adfFromGeoY,
nReqOrder );
CPLFree( padfGeoX );
CPLFree( padfGeoY );
CPLFree( padfRasterX );
CPLFree( padfRasterY );
CPLFree( panStatus );
}
if (nCRSresult != 1)
{
CPLError( CE_Failure, CPLE_AppDefined, "%s", CRS_error_message[-nCRSresult]);
GDALDestroyGCPTransformer( psInfo );
return NULL;
}
else
{
return psInfo;
}
}
/**
* Create GCP based polynomial transformer.
*
* Computes least squares fit polynomials from a provided set of GCPs,
* and stores the coefficients for later transformation of points between
* pixel/line and georeferenced coordinates.
*
* The return value should be used as a TransformArg in combination with
* the transformation function GDALGCPTransform which fits the
* GDALTransformerFunc signature. The returned transform argument should
* be deallocated with GDALDestroyGCPTransformer when no longer needed.
*
* This function may fail (returning NULL) if the provided set of GCPs
* are inadequate for the requested order, the determinate is zero or they
* are otherwise "ill conditioned".
*
* Note that 2nd order requires at least 6 GCPs, and 3rd order requires at
* least 10 gcps. If nReqOrder is 0 the highest order possible (limited to 2)
* with the provided gcp count will be used.
*
* @param nGCPCount the number of GCPs in pasGCPList.
* @param pasGCPList an array of GCPs to be used as input.
* @param nReqOrder the requested polynomial order. It should be 1, 2 or 3.
* Using 3 is not recommended due to potential numeric instabilities issues.
* @param bReversed set it to TRUE to compute the reversed transformation.
*
* @return the transform argument or NULL if creation fails.
*/
void *GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
int nReqOrder, int bReversed )
{
return GDALCreateGCPTransformerEx(nGCPCount, pasGCPList, nReqOrder, bReversed, FALSE, -1, -1);
}
/** Create GCP based polynomial transformer, with a tolerance threshold to
* discard GCPs that transform badly.
*/
void *GDALCreateGCPRefineTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
int nReqOrder, int bReversed, double dfTolerance, int nMinimumGcps)
{
//If no minimumGcp parameter was passed, we use the default value according to the model
if(nMinimumGcps == -1)
{
nMinimumGcps = ((nReqOrder+1) * (nReqOrder+2)) / 2 + 1;
}
return GDALCreateGCPTransformerEx(nGCPCount, pasGCPList, nReqOrder, bReversed, TRUE, dfTolerance, nMinimumGcps);
}
/************************************************************************/
/* GDALDestroyGCPTransformer() */
/************************************************************************/
/**
* Destroy GCP transformer.
*
* This function is used to destroy information about a GCP based
* polynomial transformation created with GDALCreateGCPTransformer().
*
* @param pTransformArg the transform arg previously returned by
* GDALCreateGCPTransformer().
*/
void GDALDestroyGCPTransformer( void *pTransformArg )
{
GCPTransformInfo *psInfo = NULL;
if( pTransformArg == NULL )
return;
psInfo = (GCPTransformInfo *) pTransformArg;
if( CPLAtomicDec(&(psInfo->nRefCount)) == 0 )
{
GDALDeinitGCPs( psInfo->nGCPCount, psInfo->pasGCPList );
CPLFree( psInfo->pasGCPList );
CPLFree( pTransformArg );
}
}
/************************************************************************/
/* GDALGCPTransform() */
/************************************************************************/
/**
* Transforms point based on GCP derived polynomial model.
*
* This function matches the GDALTransformerFunc signature, and can be
* used to transform one or more points from pixel/line coordinates to
* georeferenced coordinates (SrcToDst) or vice versa (DstToSrc).
*
* @param pTransformArg return value from GDALCreateGCPTransformer().
* @param bDstToSrc TRUE if transformation is from the destination
* (georeferenced) coordinates to pixel/line or FALSE when transforming
* from pixel/line to georeferenced coordinates.
* @param nPointCount the number of values in the x, y and z arrays.
* @param x array containing the X values to be transformed.
* @param y array containing the Y values to be transformed.
* @param z array containing the Z values to be transformed.
* @param panSuccess array in which a flag indicating success (TRUE) or
* failure (FALSE) of the transformation are placed.
*
* @return TRUE.
*/
int GDALGCPTransform( void *pTransformArg, int bDstToSrc,
int nPointCount,
double *x, double *y, CPL_UNUSED double *z,
int *panSuccess )
{
int i = 0;
GCPTransformInfo *psInfo = (GCPTransformInfo *) pTransformArg;
if( psInfo->bReversed )
bDstToSrc = !bDstToSrc;
for( i = 0; i < nPointCount; i++ )
{
if( x[i] == HUGE_VAL || y[i] == HUGE_VAL )
{
panSuccess[i] = FALSE;
continue;
}
if( bDstToSrc )
{
CRS_georef( x[i] - psInfo->x2_mean, y[i] - psInfo->y2_mean, x + i, y + i,
psInfo->adfFromGeoX, psInfo->adfFromGeoY,
psInfo->nOrder );
}
else
{
CRS_georef( x[i] - psInfo->x1_mean, y[i] - psInfo->y1_mean, x + i, y + i,
psInfo->adfToGeoX, psInfo->adfToGeoY,
psInfo->nOrder );
}
panSuccess[i] = TRUE;
}
return TRUE;
}
/************************************************************************/
/* GDALSerializeGCPTransformer() */
/************************************************************************/
CPLXMLNode *GDALSerializeGCPTransformer( void *pTransformArg )
{
CPLXMLNode *psTree = NULL;
GCPTransformInfo *psInfo = (GCPTransformInfo *) pTransformArg;
VALIDATE_POINTER1( pTransformArg, "GDALSerializeGCPTransformer", NULL );
psTree = CPLCreateXMLNode( NULL, CXT_Element, "GCPTransformer" );
/* -------------------------------------------------------------------- */
/* Serialize Order and bReversed. */
/* -------------------------------------------------------------------- */
CPLCreateXMLElementAndValue(
psTree, "Order",
CPLSPrintf( "%d", psInfo->nOrder ) );
CPLCreateXMLElementAndValue(
psTree, "Reversed",
CPLSPrintf( "%d", psInfo->bReversed ) );
if( psInfo->bRefine )
{
CPLCreateXMLElementAndValue(
psTree, "Refine",
CPLSPrintf( "%d", psInfo->bRefine ) );
CPLCreateXMLElementAndValue(
psTree, "MinimumGcps",
CPLSPrintf( "%d", psInfo->nMinimumGcps ) );
CPLCreateXMLElementAndValue(
psTree, "Tolerance",
CPLSPrintf( "%f", psInfo->dfTolerance ) );
}
/* -------------------------------------------------------------------- */
/* Attach GCP List. */
/* -------------------------------------------------------------------- */
if( psInfo->nGCPCount > 0 )
{
if(psInfo->bRefine)
{
remove_outliers(psInfo);
}
GDALSerializeGCPListToXML( psTree,
psInfo->pasGCPList,
psInfo->nGCPCount,
NULL );
}
return psTree;
}
/************************************************************************/
/* GDALDeserializeReprojectionTransformer() */
/************************************************************************/
void *GDALDeserializeGCPTransformer( CPLXMLNode *psTree )
{
GDAL_GCP *pasGCPList = 0;
int nGCPCount = 0;
void *pResult = NULL;
int nReqOrder = 0;
int bReversed = 0;
int bRefine = 0;
int nMinimumGcps = 0;
double dfTolerance = 0.0;
/* -------------------------------------------------------------------- */
/* Check for GCPs. */
/* -------------------------------------------------------------------- */
CPLXMLNode *psGCPList = CPLGetXMLNode( psTree, "GCPList" );
if( psGCPList != NULL )
{
GDALDeserializeGCPListFromXML( psGCPList,
&pasGCPList,
&nGCPCount,
NULL );
}
/* -------------------------------------------------------------------- */
/* Get other flags. */
/* -------------------------------------------------------------------- */
nReqOrder = atoi(CPLGetXMLValue(psTree,"Order","3"));
bReversed = atoi(CPLGetXMLValue(psTree,"Reversed","0"));
bRefine = atoi(CPLGetXMLValue(psTree,"Refine","0"));
nMinimumGcps = atoi(CPLGetXMLValue(psTree,"MinimumGcps","6"));
dfTolerance = CPLAtof(CPLGetXMLValue(psTree,"Tolerance","1.0"));
/* -------------------------------------------------------------------- */
/* Generate transformation. */
/* -------------------------------------------------------------------- */
if(bRefine)
{
pResult = GDALCreateGCPRefineTransformer( nGCPCount, pasGCPList, nReqOrder,
bReversed, dfTolerance, nMinimumGcps );
}
else
{
pResult = GDALCreateGCPTransformer( nGCPCount, pasGCPList, nReqOrder,
bReversed );
}
/* -------------------------------------------------------------------- */
/* Cleanup GCP copy. */
/* -------------------------------------------------------------------- */
GDALDeinitGCPs( nGCPCount, pasGCPList );
CPLFree( pasGCPList );
return pResult;
}
/************************************************************************/
/* ==================================================================== */
/* Everything below this point derived from the CRS.C from GRASS. */
/* ==================================================================== */
/************************************************************************/
/* STRUCTURE FOR USE INTERNALLY WITH THESE FUNCTIONS. THESE FUNCTIONS EXPECT
SQUARE MATRICES SO ONLY ONE VARIABLE IS GIVEN (N) FOR THE MATRIX SIZE */
struct MATRIX
{
int n; /* SIZE OF THIS MATRIX (N x N) */
double *v;
};
/* CALCULATE OFFSET INTO ARRAY BASED ON R/C */
#define M(row,col) m->v[(((row)-1)*(m->n))+(col)-1]
/***************************************************************************/
/*
FUNCTION PROTOTYPES FOR STATIC (INTERNAL) FUNCTIONS
*/
/***************************************************************************/
static int calccoef(struct Control_Points *,double,double,double *,double *,int);
static int calcls(struct Control_Points *,struct MATRIX *,double,double,
double *,double *,double *,double *);
static int exactdet(struct Control_Points *,struct MATRIX *,double,double,
double *,double *,double *,double *);
static int solvemat(struct MATRIX *,double *,double *,double *,double *);
static double term(int,double,double);
/***************************************************************************/
/*
TRANSFORM A SINGLE COORDINATE PAIR.
*/
/***************************************************************************/
static int
CRS_georef (
double e1, /* EASTINGS TO BE TRANSFORMED */
double n1, /* NORTHINGS TO BE TRANSFORMED */
double *e, /* EASTINGS TO BE TRANSFORMED */
double *n, /* NORTHINGS TO BE TRANSFORMED */
double E[], /* EASTING COEFFICIENTS */
double N[], /* NORTHING COEFFICIENTS */
int order /* ORDER OF TRANSFORMATION TO BE PERFORMED, MUST MATCH THE
ORDER USED TO CALCULATE THE COEFFICIENTS */
)
{
double e3 = 0.0;
double e2n = 0.0;
double en2 = 0.0;
double n3 = 0.0;
double e2 = 0.0;
double en = 0.0;
double n2 = 0.0;
switch(order)
{
case 1:
*e = E[0] + E[1] * e1 + E[2] * n1;
*n = N[0] + N[1] * e1 + N[2] * n1;
break;
case 2:
e2 = e1 * e1;
n2 = n1 * n1;
en = e1 * n1;
*e = E[0] + E[1] * e1 + E[2] * n1 +
E[3] * e2 + E[4] * en + E[5] * n2;
*n = N[0] + N[1] * e1 + N[2] * n1 +
N[3] * e2 + N[4] * en + N[5] * n2;
break;
case 3:
e2 = e1 * e1;
en = e1 * n1;
n2 = n1 * n1;
e3 = e1 * e2;
e2n = e2 * n1;
en2 = e1 * n2;
n3 = n1 * n2;
*e = E[0] +
E[1] * e1 + E[2] * n1 +
E[3] * e2 + E[4] * en + E[5] * n2 +
E[6] * e3 + E[7] * e2n + E[8] * en2 + E[9] * n3;
*n = N[0] +
N[1] * e1 + N[2] * n1 +
N[3] * e2 + N[4] * en + N[5] * n2 +
N[6] * e3 + N[7] * e2n + N[8] * en2 + N[9] * n3;
break;
default:
return(MPARMERR);
}
return(MSUCCESS);
}
/***************************************************************************/
/*
COMPUTE THE GEOREFFERENCING COEFFICIENTS BASED ON A SET OF CONTROL POINTS
*/
/***************************************************************************/
static int
CRS_compute_georef_equations (GCPTransformInfo *psInfo, struct Control_Points *cp,
double E12[], double N12[],
double E21[], double N21[],
int order)
{
double *tempptr = NULL;
int status = 0;
if(order < 1 || order > MAXORDER)
return(MPARMERR);
/* CALCULATE THE FORWARD TRANSFORMATION COEFFICIENTS */
status = calccoef(cp,psInfo->x1_mean,psInfo->y1_mean,E12,N12,order);
if(status != MSUCCESS)
return(status);
/* SWITCH THE 1 AND 2 EASTING AND NORTHING ARRAYS */
tempptr = cp->e1;
cp->e1 = cp->e2;
cp->e2 = tempptr;
tempptr = cp->n1;
cp->n1 = cp->n2;
cp->n2 = tempptr;
/* CALCULATE THE BACKWARD TRANSFORMATION COEFFICIENTS */
status = calccoef(cp,psInfo->x2_mean,psInfo->y2_mean,E21,N21,order);
/* SWITCH THE 1 AND 2 EASTING AND NORTHING ARRAYS BACK */
tempptr = cp->e1;
cp->e1 = cp->e2;
cp->e2 = tempptr;
tempptr = cp->n1;
cp->n1 = cp->n2;
cp->n2 = tempptr;
return(status);
}
/***************************************************************************/
/*
COMPUTE THE GEOREFFERENCING COEFFICIENTS BASED ON A SET OF CONTROL POINTS
*/
/***************************************************************************/
static int
calccoef (struct Control_Points *cp, double x_mean, double y_mean, double E[], double N[], int order)
{
struct MATRIX m;
double *a = NULL;
double *b = NULL;
int numactive = 0; /* NUMBER OF ACTIVE CONTROL POINTS */
int status = 0;
int i = 0;
memset( &m, 0, sizeof(m) );
/* CALCULATE THE NUMBER OF VALID CONTROL POINTS */
for(i = numactive = 0 ; i < cp->count ; i++)
{
if(cp->status[i] > 0)
numactive++;
}
/* CALCULATE THE MINIMUM NUMBER OF CONTROL POINTS NEEDED TO DETERMINE
A TRANSFORMATION OF THIS ORDER */
m.n = ((order + 1) * (order + 2)) / 2;
if(numactive < m.n)
return(MNPTERR);
/* INITIALIZE MATRIX */
m.v = (double *)CPLCalloc(m.n*m.n,sizeof(double));
if(m.v == NULL)
{
return(MMEMERR);
}
a = (double *)CPLCalloc(m.n,sizeof(double));
if(a == NULL)
{
CPLFree((char *)m.v);
return(MMEMERR);
}
b = (double *)CPLCalloc(m.n,sizeof(double));
if(b == NULL)
{
CPLFree((char *)m.v);
CPLFree((char *)a);
return(MMEMERR);
}
if(numactive == m.n)
status = exactdet(cp,&m, x_mean, y_mean, a,b,E,N);
else
status = calcls(cp,&m, x_mean, y_mean,a,b,E,N);
CPLFree((char *)m.v);
CPLFree((char *)a);
CPLFree((char *)b);
return(status);
}
/***************************************************************************/
/*
CALCULATE THE TRANSFORMATION COEFFICIENTS WITH EXACTLY THE MINIMUM
NUMBER OF CONTROL POINTS REQUIRED FOR THIS TRANSFORMATION.
*/
/***************************************************************************/
static int exactdet (
struct Control_Points *cp,
struct MATRIX *m,
double x_mean,
double y_mean,
double a[],
double b[],
double E[], /* EASTING COEFFICIENTS */
double N[] /* NORTHING COEFFICIENTS */
)
{
int pntnow = 0;
int currow = 1;
int j = 0;
for(pntnow = 0 ; pntnow < cp->count ; pntnow++)
{
if(cp->status[pntnow] > 0)
{
/* POPULATE MATRIX M */
for(j = 1 ; j <= m->n ; j++)
{
M(currow,j) = term(j,cp->e1[pntnow] - x_mean, cp->n1[pntnow] - y_mean);
}
/* POPULATE MATRIX A AND B */
a[currow-1] = cp->e2[pntnow];
b[currow-1] = cp->n2[pntnow];
currow++;
}
}
if(currow - 1 != m->n)
return(MINTERR);
return(solvemat(m,a,b,E,N));
}
/***************************************************************************/
/*
CALCULATE THE TRANSFORMATION COEFFICIENTS WITH MORE THAN THE MINIMUM
NUMBER OF CONTROL POINTS REQUIRED FOR THIS TRANSFORMATION. THIS
ROUTINE USES THE LEAST SQUARES METHOD TO COMPUTE THE COEFFICIENTS.
*/
/***************************************************************************/
static int calcls (
struct Control_Points *cp,
struct MATRIX *m,
double x_mean,
double y_mean,
double a[],
double b[],
double E[], /* EASTING COEFFICIENTS */
double N[] /* NORTHING COEFFICIENTS */
)
{
int i = 0, j = 0, n = 0, numactive = 0;
/* INITIALIZE THE UPPER HALF OF THE MATRIX AND THE TWO COLUMN VECTORS */
for(i = 1 ; i <= m->n ; i++)
{
for(j = i ; j <= m->n ; j++)
M(i,j) = 0.0;
a[i-1] = b[i-1] = 0.0;
}
/* SUM THE UPPER HALF OF THE MATRIX AND THE COLUMN VECTORS ACCORDING TO
THE LEAST SQUARES METHOD OF SOLVING OVER DETERMINED SYSTEMS */
for(n = 0 ; n < cp->count ; n++)
{
if(cp->status[n] > 0)
{
numactive++;
for(i = 1 ; i <= m->n ; i++)
{
for(j = i ; j <= m->n ; j++)
M(i,j) += term(i,cp->e1[n] - x_mean, cp->n1[n] - y_mean) * term(j,cp->e1[n] - x_mean, cp->n1[n] - y_mean);
a[i-1] += cp->e2[n] * term(i,cp->e1[n] - x_mean, cp->n1[n] - y_mean);
b[i-1] += cp->n2[n] * term(i,cp->e1[n] - x_mean, cp->n1[n] - y_mean);
}
}
}
if(numactive <= m->n)
return(MINTERR);
/* TRANSPOSE VALUES IN UPPER HALF OF M TO OTHER HALF */
for(i = 2 ; i <= m->n ; i++)
{
for(j = 1 ; j < i ; j++)
M(i,j) = M(j,i);
}
return(solvemat(m,a,b,E,N));
}
/***************************************************************************/
/*
CALCULATE THE X/Y TERM BASED ON THE TERM NUMBER
ORDER\TERM 1 2 3 4 5 6 7 8 9 10
1 e0n0 e1n0 e0n1
2 e0n0 e1n0 e0n1 e2n0 e1n1 e0n2
3 e0n0 e1n0 e0n1 e2n0 e1n1 e0n2 e3n0 e2n1 e1n2 e0n3
*/
/***************************************************************************/
static double term (int nTerm, double e, double n)
{
switch(nTerm)
{
case 1: return((double)1.0);
case 2: return((double)e);
case 3: return((double)n);
case 4: return((double)(e*e));
case 5: return((double)(e*n));
case 6: return((double)(n*n));
case 7: return((double)(e*e*e));
case 8: return((double)(e*e*n));
case 9: return((double)(e*n*n));
case 10: return((double)(n*n*n));
}
return((double)0.0);
}
/***************************************************************************/
/*
SOLVE FOR THE 'E' AND 'N' COEFFICIENTS BY USING A SOMEWHAT MODIFIED
GAUSSIAN ELIMINATION METHOD.
| M11 M12 ... M1n | | E0 | | a0 |
| M21 M22 ... M2n | | E1 | = | a1 |
| . . . . | | . | | . |
| Mn1 Mn2 ... Mnn | | En-1 | | an-1 |
and
| M11 M12 ... M1n | | N0 | | b0 |
| M21 M22 ... M2n | | N1 | = | b1 |
| . . . . | | . | | . |
| Mn1 Mn2 ... Mnn | | Nn-1 | | bn-1 |
*/
/***************************************************************************/
static int solvemat (struct MATRIX *m,
double a[], double b[], double E[], double N[])
{
int i = 0;
int j = 0;
int i2 = 0;
int j2 = 0;
int imark = 0;
double factor = 0.0;
double temp = 0.0;
double pivot = 0.0; /* ACTUAL VALUE OF THE LARGEST PIVOT CANDIDATE */
for(i = 1 ; i <= m->n ; i++)
{
j = i;
/* find row with largest magnitude value for pivot value */
pivot = M(i,j);
imark = i;
for(i2 = i + 1 ; i2 <= m->n ; i2++)
{
temp = fabs(M(i2,j));
if(temp > fabs(pivot))
{
pivot = M(i2,j);
imark = i2;
}
}
/* if the pivot is very small then the points are nearly co-linear */
/* co-linear points result in an undefined matrix, and nearly */
/* co-linear points results in a solution with rounding error */
if(pivot == 0.0)
return(MUNSOLVABLE);
/* if row with highest pivot is not the current row, switch them */
if(imark != i)
{
for(j2 = 1 ; j2 <= m->n ; j2++)
{
temp = M(imark,j2);
M(imark,j2) = M(i,j2);
M(i,j2) = temp;
}
temp = a[imark-1];
a[imark-1] = a[i-1];
a[i-1] = temp;
temp = b[imark-1];
b[imark-1] = b[i-1];
b[i-1] = temp;
}
/* compute zeros above and below the pivot, and compute
values for the rest of the row as well */
for(i2 = 1 ; i2 <= m->n ; i2++)
{
if(i2 != i)
{
factor = M(i2,j) / pivot;
for(j2 = j ; j2 <= m->n ; j2++)
M(i2,j2) -= factor * M(i,j2);
a[i2-1] -= factor * a[i-1];
b[i2-1] -= factor * b[i-1];
}
}
}
/* SINCE ALL OTHER VALUES IN THE MATRIX ARE ZERO NOW, CALCULATE THE
COEFFICIENTS BY DIVIDING THE COLUMN VECTORS BY THE DIAGONAL VALUES. */
for(i = 1 ; i <= m->n ; i++)
{
E[i-1] = a[i-1] / M(i,i);
N[i-1] = b[i-1] / M(i,i);
}
return(MSUCCESS);
}
/***************************************************************************/
/*
DETECTS THE WORST OUTLIER IN THE GCP LIST AND RETURNS THE INDEX OF THE
OUTLIER.
THE WORST OUTLIER IS CALCULATED BASED ON THE CONTROL POINTS, COEFFICIENTS
AND THE ALLOWED TOLERANCE:
sampleAdj = a0 + a1*sample + a2*line + a3*line*sample
lineAdj = b0 + b1*sample + b2*line + b3*line*sample
WHERE sampleAdj AND lineAdj ARE CORRELATED GCPS
[residualSample] = [A1][sampleCoefficients] - [b1]
[residualLine] = [A2][lineCoefficients] - [b2]
sampleResidual^2 = sum( [residualSample]^2 )
lineResidual^2 = sum( [lineSample]^2 )
residuals(i) = squareRoot( residualSample(i)^2 + residualLine(i)^2 )
THE GCP WITH THE GREATEST DISTANCE residual(i) GREATER THAN THE TOLERANCE WILL
CONSIDERED THE WORST OUTLIER.
IF NO OUTLIER CAN BE FOUND, -1 WILL BE RETURNED.
*/
/***************************************************************************/
static int worst_outlier(struct Control_Points *cp, double x_mean, double y_mean, int nOrder, double E[], double N[], double dfTolerance)
{
int nI = 0, nIndex = 0;
double dfDifference = 0.0;
double dfSampleRes = 0.0;
double dfLineRes = 0.0;
double dfCurrentDifference = 0.0;
double dfSampleResidual = 0.0;
double dfLineResidual = 0.0;
double *padfResiduals = (double *) CPLCalloc(sizeof(double),cp->count);
for(nI = 0; nI < cp->count; nI++)
{
CRS_georef( cp->e1[nI] - x_mean, cp->n1[nI] - y_mean, &dfSampleRes, &dfLineRes,E,N,nOrder );
dfSampleRes -= cp->e2[nI];
dfLineRes -= cp->n2[nI];
dfSampleResidual += dfSampleRes*dfSampleRes;
dfLineResidual += dfLineRes*dfLineRes;
padfResiduals[nI] = sqrt(dfSampleRes*dfSampleRes + dfLineRes*dfLineRes);
}
nIndex = -1;
dfDifference = -1.0;
for(nI = 0; nI < cp->count; nI++)
{
dfCurrentDifference = padfResiduals[nI];
if(fabs(dfCurrentDifference) < 1.19209290E-07F /*FLT_EPSILON*/)
{
dfCurrentDifference = 0.0;
}
if(dfCurrentDifference > dfDifference && dfCurrentDifference >= dfTolerance)
{
dfDifference = dfCurrentDifference;
nIndex = nI;
}
}
CPLFree( padfResiduals );
return nIndex;
}
/***************************************************************************/
/*
REMOVES THE WORST OUTLIERS ITERATIVELY UNTIL THE MINIMUM NUMBER OF GCPS
ARE REACHED OR NO OUTLIERS CAN BE DETECTED.
1. WE CALCULATE THE COEFFICIENTS FOR ALL THE GCPS.
2. THE GCP LIST WILL BE SCANNED TO DETERMINE THE WORST OUTLIER USING
THE CALCULATED COEFFICIENTS.
3. THE WORST OUTLIER WILL BE REMOVED FROM THE GCP LIST.
4. THE COEFFICIENTS WILL BE RECALCULATED WITHOUT THE WORST OUTLIER.
5. STEP 1 TO 4 ARE EXECUTED UNTIL THE MINIMUM NUMBER OF GCPS WERE REACHED
OR IF NO GCP IS CONSIDERED AN OUTLIER WITH THE PASSED TOLERANCE.
*/
/***************************************************************************/
static int remove_outliers( GCPTransformInfo *psInfo )
{
double *padfGeoX = NULL;
double *padfGeoY = NULL;
double *padfRasterX = NULL;
double *padfRasterY = NULL;
int *panStatus = NULL;
int nI = 0;
int nCRSresult = 0;
int nGCPCount = 0;
int nMinimumGcps = 0;
int nReqOrder = 0;
double dfTolerance = 0;
struct Control_Points sPoints;
double x1_sum = 0;
double y1_sum = 0;
double x2_sum = 0;
double y2_sum = 0;
memset( &sPoints, 0, sizeof(sPoints) );
nGCPCount = psInfo->nGCPCount;
nMinimumGcps = psInfo->nMinimumGcps;
nReqOrder = psInfo->nOrder;
dfTolerance = psInfo->dfTolerance;
padfGeoX = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfGeoY = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfRasterX = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfRasterY = (double *) CPLCalloc(sizeof(double),nGCPCount);
panStatus = (int *) CPLCalloc(sizeof(int),nGCPCount);
for( nI = 0; nI < nGCPCount; nI++ )
{
panStatus[nI] = 1;
padfGeoX[nI] = psInfo->pasGCPList[nI].dfGCPX;
padfGeoY[nI] = psInfo->pasGCPList[nI].dfGCPY;
padfRasterX[nI] = psInfo->pasGCPList[nI].dfGCPPixel;
padfRasterY[nI] = psInfo->pasGCPList[nI].dfGCPLine;
x1_sum += psInfo->pasGCPList[nI].dfGCPPixel;
y1_sum += psInfo->pasGCPList[nI].dfGCPLine;
x2_sum += psInfo->pasGCPList[nI].dfGCPX;
y2_sum += psInfo->pasGCPList[nI].dfGCPY;
}
psInfo->x1_mean = x1_sum / nGCPCount;
psInfo->y1_mean = y1_sum / nGCPCount;
psInfo->x2_mean = x2_sum / nGCPCount;
psInfo->y2_mean = y2_sum / nGCPCount;
sPoints.count = nGCPCount;
sPoints.e1 = padfRasterX;
sPoints.n1 = padfRasterY;
sPoints.e2 = padfGeoX;
sPoints.n2 = padfGeoY;
sPoints.status = panStatus;
nCRSresult = CRS_compute_georef_equations( psInfo, &sPoints,
psInfo->adfToGeoX, psInfo->adfToGeoY,
psInfo->adfFromGeoX, psInfo->adfFromGeoY,
nReqOrder );
while(sPoints.count > nMinimumGcps)
{
int nIndex =
worst_outlier(&sPoints, psInfo->x1_mean, psInfo->y1_mean, psInfo->nOrder,
psInfo->adfToGeoX, psInfo->adfToGeoY,
dfTolerance);
//If no outliers were detected, stop the GCP elimination
if(nIndex == -1)
{
break;
}
CPLFree(psInfo->pasGCPList[nIndex].pszId);
CPLFree(psInfo->pasGCPList[nIndex].pszInfo);
for( nI = nIndex; nI < sPoints.count - 1; nI++ )
{
sPoints.e1[nI] = sPoints.e1[nI + 1];
sPoints.n1[nI] = sPoints.n1[nI + 1];
sPoints.e2[nI] = sPoints.e2[nI + 1];
sPoints.n2[nI] = sPoints.n2[nI + 1];
psInfo->pasGCPList[nI].pszId = psInfo->pasGCPList[nI + 1].pszId;
psInfo->pasGCPList[nI].pszInfo = psInfo->pasGCPList[nI + 1].pszInfo;
}
sPoints.count = sPoints.count - 1;
nCRSresult = CRS_compute_georef_equations( psInfo, &sPoints,
psInfo->adfToGeoX, psInfo->adfToGeoY,
psInfo->adfFromGeoX, psInfo->adfFromGeoY,
nReqOrder );
}
for( nI = 0; nI < sPoints.count; nI++ )
{
psInfo->pasGCPList[nI].dfGCPX = sPoints.e2[nI];
psInfo->pasGCPList[nI].dfGCPY = sPoints.n2[nI];
psInfo->pasGCPList[nI].dfGCPPixel = sPoints.e1[nI];
psInfo->pasGCPList[nI].dfGCPLine = sPoints.n1[nI];
}
psInfo->nGCPCount = sPoints.count;
CPLFree( sPoints.e1 );
CPLFree( sPoints.n1 );
CPLFree( sPoints.e2 );
CPLFree( sPoints.n2 );
CPLFree( sPoints.status );
return nCRSresult;
}
|
9264c30f89ff7e96fdeffba1067f8daa1021210b
|
e73547787354afd9b717ea57fe8dd0695d161821
|
/src/battle/area/trd_part_2/actor/boss.h
|
26092e903d9362ae45b6059164fafa776fd3b2e6
|
[] |
no_license
|
pmret/papermario
|
8b514b19653cef8d6145e47499b3636b8c474a37
|
9774b26d93f1045dd2a67e502b6efc9599fb6c31
|
refs/heads/main
| 2023-08-31T07:09:48.951514
| 2023-08-21T18:07:08
| 2023-08-21T18:07:08
| 287,151,133
| 904
| 139
| null | 2023-09-14T02:44:23
| 2020-08-13T01:22:57
|
C
|
UTF-8
|
C
| false
| false
| 4,157
|
h
|
boss.h
|
#include "common.h"
/**
* Koopa Bros Boss Fight
*
* The fake_bowser actor controls both parts of the boss battle.
* During the first part, it uses ANIM commands defined in fake_bowser to animate models from trd_00 forming the parts
* of its body. In this phase, each group of models (head, shell, feet, etc.) are tethered to a corresponding ActorPart
* which the animation scripts operate on.
*
* During the second part, four 'dummy' Koopa Bros actors are enabled, which all have identical behavior. Their actions
* are completely governed by fake_bowser; they are only responsible for executing animations in response to commands
* issued by fake_bowser. These commands are listed in the enum below as BOSS_CMD_*. They mostly pertain to the state of
* the 'tower'.
*
* During each turn, fake_bowser will attempt to form a Koopa Bros tower. If none exists, all standing Koopa Bros are
* used to create one. If one already exists and an idle Koopa Bros is found, they are joined with the tower (This can
* occur if the Koopa in question wass incapacitated when the tower was built). If a valid tower exists, a spin attack
* is executed.
*
* The tower topples when hit twice in one turn by the player or when hit with an explosive or electic attack. A single
* hit puts the tower into an 'unstable' or 'tipping' state. If not knocked over by the start of fake_bowser's turn,
* the tower will regain stability.
*
* The current state of the tower is stored in fake_bowser's actor var AVAR_Boss_TowerState
* The state of each Koopa is stored in their actor var AVAR_Koopa_State
*/
enum N(ActorIDs) {
GREEN_ACTOR = ACTOR_ENEMY0,
YELLOW_ACTOR = ACTOR_ENEMY1,
BLACK_ACTOR = ACTOR_ENEMY2,
RED_ACTOR = ACTOR_ENEMY3,
BOSS_ACTOR = ACTOR_ENEMY4,
FIRST_KOOPA_ACTOR = ACTOR_ENEMY0,
};
enum {
// boss actor vars
AVAR_Boss_Flags = 0,
AVAR_Boss_TowerState = 1,
AVAR_Boss_BowserTaunts = 2,
AVAR_Boss_TowerHeight = 3,
AVAR_Boss_TopKoopaID = 4, // top of the tower upon tower formation
AVAR_Boss_LeadKoopaID = 5, // top of the tower during spin attack (invalid at other times)
// flag values for boss var 0
AFLAG_Boss_KoopaBrosRevealed = 0x001,
AFLAG_Boss_Dialogue_HaveATaste = 0x002,
AFLAG_Boss_Dialogue_SpinAttack = 0x004,
AFLAG_Boss_Dialogue_BowserReveal = 0x008,
AFLAG_Boss_TowerUnstable = 0x010,
AFLAG_Boss_Dialogue_WereGoingOver = 0x020,
AFLAG_Boss_PlayerHitTower = 0x040,
AFLAG_Boss_PartnerHitTower = 0x080,
AFLAG_Boss_DoneTowerUpdate = 0x100,
AFLAG_Boss_DoingSoloAttack = 0x200,
// state values for tower (AVAR_Boss_TowerState)
AVAL_Boss_TowerState_None = 0,
AVAL_Boss_TowerState_Stable = 1,
AVAL_Boss_TowerState_Unstable = 2,
AVAL_Boss_TowerState_Toppled = 3, // also init value to prevent first-turn tower attack
// actor vars for each koopa
AVAR_Koopa_State = 1,
AVAR_Koopa_ToppledTurns = 2, // number of toppled turns remaining
// state values for koopas (AVAR_Koopa_State)
AVAL_Koopa_State_Ready = 0,
AVAL_Koopa_State_Toppled = 1,
AVAL_Koopa_State_GotUp = 2,
AVAL_Koopa_State_PosA = 3, // top position
AVAL_Koopa_State_PosD = 4, // above posC
AVAL_Koopa_State_PosC = 5, // above posB
AVAL_Koopa_State_PosB = 6, // bottom position
// position in the koopa bros tower
TOWER_TOP = 0,
TOWER_DOWN_1 = 1,
TOWER_DOWN_2 = 2,
TOWER_DOWN_3 = 3,
// commands sent to koopa bros from boss
BOSS_CMD_STABLE = 0,
BOSS_CMD_UNSTABLE = 1,
BOSS_CMD_HIT = 2,
BOSS_CMD_BURN_HIT = 3,
BOSS_CMD_NO_DAMAGE_HIT = 4,
BOSS_CMD_TOPPLE_HIT = 5,
BOSS_CMD_TOPPLE_BURN_HIT = 6,
BOSS_CMD_SPIN_ATTACK = 7,
BOSS_CMD_SOLO_ATTACK = 8,
BOSS_CMD_TRY_GET_UP = 9,
BOSS_CMD_GET_READY = 10,
};
|
17eef133cd9fb526f7c9457d838c3e3a35d17e02
|
0fde82bf8a529c1045595b0f451dc7005a9d90cf
|
/generate/novas/eph_manager.c
|
c4f9f6bfbffe2ac5c203aa6adea76b3e63f92446
|
[
"MIT"
] |
permissive
|
cosinekitty/astronomy
|
18ccec1d62bbae24a8424b3eb807f4b3b97c04a1
|
056076b85aa591ba756ef8a24fc017ddb3b3029b
|
refs/heads/master
| 2023-09-04T18:00:34.676849
| 2023-08-28T19:20:08
| 2023-08-28T19:20:08
| 180,022,816
| 305
| 56
|
MIT
| 2023-08-28T19:20:10
| 2019-04-07T20:55:20
|
C
|
UTF-8
|
C
| false
| false
| 25,111
|
c
|
eph_manager.c
|
/*
Naval Observatory Vector Astrometry Software (NOVAS)
C Edition, Version 3.1
eph_manager.c: C version of JPL Ephemeris Manager for use with solsys1
U. S. Naval Observatory
Astronomical Applications Dept.
Washington, DC
http://www.usno.navy.mil/USNO/astronomical-applications
*/
#ifndef _EPHMAN_
#include "eph_manager.h"
#endif
/*
Define global variables
*/
short int KM;
/*
IPT and LPT defined as int to support 64 bit systems.
*/
int IPT[3][12], LPT[3];
long int NRL, NP, NV;
long int RECORD_LENGTH;
double SS[3], JPLAU, PC[18], VC[18], TWOT, EM_RATIO;
double *BUFFER;
FILE *EPHFILE = NULL;
/********ephem_open */
short int ephem_open (char *ephem_name,
double *jd_begin, double *jd_end,
short int *de_number)
/*
------------------------------------------------------------------------
PURPOSE:
This function opens a JPL planetary ephemeris file and
sets initial values. This function must be called
prior to calls to the other JPL ephemeris functions.
REFERENCES:
Standish, E.M. and Newhall, X X (1988). "The JPL Export
Planetary Ephemeris"; JPL document dated 17 June 1988.
INPUT
ARGUMENTS:
*ephem_name (char)
Name of the direct-access ephemeris file.
OUTPUT
ARGUMENTS:
*jd_begin (double)
Beginning Julian date of the ephemeris file.
*jd_end (double)
Ending Julian date of the ephemeris file.
*de_number (short int)
DE number of the ephemeris file opened.
RETURNED
VALUE:
(short int)
0 ...file exists and is opened correctly.
1 ...file does not exist/not found.
2-10...error reading from file header.
11 ...unable to set record length; ephemeris (DE number)
not in look-up table.
GLOBALS
USED:
SS eph_manager.h
JPLAU eph_manager.h
PC eph_manager.h
VC eph_manager.h
TWOT eph_manager.h
EM_RATIO eph_manager.h
BUFFER eph_manager.h
IPT eph_manager.h
LPT eph_manager.h
NRL eph_manager.h
KM eph_manager.h
NP eph_manager.h
NV eph_manager.h
RECORD_LENGTH eph_manager.h
EPHFILE eph_manager.h
FUNCTIONS
CALLED:
fclose stdio.h
free stdlib.h
fopen stdio.h
fread stdio.h
calloc stdlib.h
VER./DATE/
PROGRAMMER:
V1.0/06-90/JAB (USNO/NA)
V1.1/06-92/JAB (USNO/AA): Restructure and add initializations.
V1.2/07-98/WTH (USNO/AA): Modified to open files for different
ephemeris types. (200,403,404,405,406)
V1.3/11-07/WKP (USNO/AA): Updated prolog.
V1.4/09-10/WKP (USNO/AA): Changed ncon and denum variables and
sizeof ipt array to type 'int' for
64-bit system compatibility.
V1.5/09-10/WTH (USNO/AA): Added support for DE421, default case
for switch, close file on error.
V1.6/10-10/WKP (USNO/AA): Renamed function to lowercase to
comply with coding standards.
NOTES:
KM...flag defining physical units of the output states.
= 1, km and km/sec
= 0, AU and AU/day
Default value is 0 (KM determines time unit for nutations.
Angle unit is always radians.)
------------------------------------------------------------------------
*/
{
char ttl[252], cnam[2400];
short int i, j;
int ncon, denum;
ephem_close();
/*
Open file ephem_name.
*/
if ((EPHFILE = fopen (ephem_name, "rb")) == NULL)
{
return 1;
}
else
{
/*
File found. Set initializations and default values.
*/
KM = 0;
NRL = 0;
NP = 2;
NV = 3;
TWOT = 0.0;
for (i = 0; i < 18; i++)
{
PC[i] = 0.0;
VC[i] = 0.0;
}
PC[0] = 1.0;
VC[1] = 1.0;
/*
Read in values from the first record, aka the header.
*/
if (fread (ttl, sizeof ttl, 1, EPHFILE) != 1)
{
ephem_close();
return 2;
}
if (fread (cnam, sizeof cnam, 1, EPHFILE) != 1)
{
ephem_close();
return 3;
}
if (fread (SS, sizeof SS, 1, EPHFILE) != 1)
{
ephem_close();
return 4;
}
if (fread (&ncon, sizeof ncon, 1, EPHFILE) != 1)
{
ephem_close();
return 5;
}
if (fread (&JPLAU, sizeof JPLAU, 1, EPHFILE) != 1)
{
ephem_close();
return 6;
}
if (fread (&EM_RATIO, sizeof EM_RATIO, 1, EPHFILE) != 1)
{
ephem_close();
return 7;
}
for (i = 0; i < 12; i++)
for (j = 0; j < 3; j++)
if (fread (&IPT[j][i], sizeof(int), 1, EPHFILE) != 1)
{
ephem_close();
return 8;
}
if (fread (&denum, sizeof denum, 1, EPHFILE) != 1)
{
ephem_close();
return 9;
}
if (fread (LPT, sizeof LPT, 1, EPHFILE) != 1)
{
ephem_close();
return 10;
}
/*
Set the value of the record length according to what JPL ephemeris is
being opened.
*/
switch (denum)
{
case 200:
RECORD_LENGTH = 6608;
break;
case 403: case 405:
case 421:
RECORD_LENGTH = 8144;
break;
case 404: case 406:
RECORD_LENGTH = 5824;
break;
/*
An unknown DE file was opened. Close the file and return an error
code.
*/
default:
*jd_begin = 0.0;
*jd_end = 0.0;
*de_number = 0;
ephem_close();
return 11;
}
BUFFER = (double *) calloc (RECORD_LENGTH / 8, sizeof(double));
*de_number = (short int) denum;
*jd_begin = SS[0];
*jd_end = SS[1];
}
return 0;
}
/********ephem_close */
short int ephem_close (void)
/*
------------------------------------------------------------------------
PURPOSE:
This function closes a JPL planetary ephemeris file and frees the
memory.
REFERENCES:
Standish, E.M. and Newhall, X X (1988). "The JPL Export
Planetary Ephemeris"; JPL document dated 17 June 1988.
INPUT
ARGUMENTS:
None.
OUTPUT
ARGUMENTS:
None.
RETURNED
VALUE:
(short int)
0 ...file was already closed or closed correctly.
EOF...error closing file.
GLOBALS
USED:
BUFFER eph_manager.h
EPHFILE eph_manager.h
FUNCTIONS
CALLED:
fclose stdio.h
free stdlib.h
VER./DATE/
PROGRAMMER:
V1.0/11-07/WKP (USNO/AA)
V1.1/09-10/WKP (USNO/AA): Explicitly cast fclose return value to
type 'short int'.
V1.2/10-10/WKP (USNO/AA): Renamed function to lowercase to
comply with coding standards.
NOTES:
None.
------------------------------------------------------------------------
*/
{
short int error = 0;
if (EPHFILE)
{
error = (short int) fclose (EPHFILE);
EPHFILE = NULL; /* modified per errata in https://aa.usno.navy.mil/software/novas/novas_faq.php */
}
if (BUFFER)
{
free (BUFFER);
BUFFER = NULL;
}
return error;
}
/********planet_ephemeris */
short int planet_ephemeris (double tjd[2], short int target,
short int center,
double *position, double *velocity)
/*
------------------------------------------------------------------------
PURPOSE:
This function accesses the JPL planetary ephemeris to give the
position and velocity of the target object with respect to the
center object.
REFERENCES:
Standish, E.M. and Newhall, X X (1988). "The JPL Export
Planetary Ephemeris"; JPL document dated 17 June 1988.
INPUT
ARGUMENTS:
tjd[2] (double)
Two-element array containing the Julian date, which may be
split any way (although the first element is usually the
"integer" part, and the second element is the "fractional"
part). Julian date is in the TDB or "T_eph" time scale.
target (short int)
Number of 'target' point.
center (short int)
Number of 'center' (origin) point.
The numbering convention for 'target' and'center' is:
0 = Mercury 7 = Neptune
1 = Venus 8 = Pluto
2 = Earth 9 = Moon
3 = Mars 10 = Sun
4 = Jupiter 11 = Solar system bary.
5 = Saturn 12 = Earth-Moon bary.
6 = Uranus 13 = Nutations (long int. and obliq.)
(If nutations are desired, set 'target' = 13;
'center' will be ignored on that call.)
OUTPUT
ARGUMENTS:
*position (double)
Position vector array of target relative to center, measured
in AU.
*velocity (double)
Velocity vector array of target relative to center, measured
in AU/day.
RETURNED
VALUE:
(short int)
0 ...everything OK.
1,2...error returned from State.
GLOBALS
USED:
EM_RATIO eph_manager.h
FUNCTIONS
CALLED:
state eph_manager.h
VER./DATE/
PROGRAMMER:
V1.0/03-93/WTH (USNO/AA): Convert FORTRAN to C.
V1.1/07-93/WTH (USNO/AA): Update to C standards.
V2.0/07-98/WTH (USNO/AA): Modified for ease of use and linearity.
V3.0/11-06/JAB (USNO/AA): Allowed for use of input 'split' Julian
date for higher precision.
V3.1/11-07/WKP (USNO/AA): Updated prolog and error codes.
V3.1/12-07/WKP (USNO/AA): Removed unreferenced variables.
V3.2/10-10/WKP (USNO/AA): Renamed function to lowercase to
comply with coding standards.
NOTES:
None.
------------------------------------------------------------------------
*/
{
short int i, error = 0, earth = 2, moon = 9;
short int do_earth = 0, do_moon = 0;
double jed[2];
double pos_moon[3] = {0.0,0.0,0.0}, vel_moon[3] = {0.0,0.0,0.0},
pos_earth[3] = {0.0,0.0,0.0}, vel_earth[3] = {0.0,0.0,0.0};
double target_pos[3] = {0.0,0.0,0.0}, target_vel[3] = {0.0,0.0,0.0},
center_pos[3] = {0.0,0.0,0.0}, center_vel[3] = {0.0,0.0,0.0};
/*
Initialize 'jed' for 'state' and set up component count.
*/
jed[0] = tjd[0];
jed[1] = tjd[1];
/*
Check for target point = center point.
*/
if (target == center)
{
for (i = 0; i < 3; i++)
{
position[i] = 0.0;
velocity[i] = 0.0;
}
return 0;
}
/*
Check for instances of target or center being Earth or Moon,
and for target or center being the Earth-Moon barycenter.
*/
if ((target == earth) || (center == earth))
do_moon = 1;
if ((target == moon) || (center == moon))
do_earth = 1;
if ((target == 12) || (center == 12))
do_earth = 1;
if (do_earth)
{
error = state (jed,2, pos_earth,vel_earth);
if (error)
return error;
}
if (do_moon)
{
error = state (jed,9, pos_moon,vel_moon);
if (error)
return error;
}
/*
Make call to State for target object.
*/
if (target == 11)
{
for (i = 0; i < 3; i++)
{
target_pos[i] = 0.0;
target_vel[i] = 0.0;
}
}
else if (target == 12)
{
for (i = 0; i < 3; i++)
{
target_pos[i] = pos_earth[i];
target_vel[i] = vel_earth[i];
}
}
else
error = state (jed,target, target_pos,target_vel);
if (error)
return error;
/*
Make call to State for center object.
*/
/*
If the requested center is the Solar System barycenter,
then don't bother with a second call to State.
*/
if (center == 11)
{
for (i = 0; i < 3; i++)
{
center_pos[i] = 0.0;
center_vel[i] = 0.0;
}
}
/*
Center is Earth-Moon barycenter, which was already computed above.
*/
else if (center == 12)
{
for (i = 0; i < 3; i++)
{
center_pos[i] = pos_earth[i];
center_vel[i] = vel_earth[i];
}
}
else
error = state (jed,center, center_pos,center_vel);
if (error)
return error;
/*
Check for cases of Earth as target and Moon as center or vice versa.
*/
if ((target == earth) && (center == moon))
{
for (i = 0; i < 3; i++)
{
position[i] = -center_pos[i];
velocity[i] = -center_vel[i];
}
return 0;
}
else if ((target == moon) && (center == earth))
{
for (i = 0; i < 3; i++)
{
position[i] = target_pos[i];
velocity[i] = target_vel[i];
}
return 0;
}
/*
Check for Earth as target, or as center.
*/
else if (target == earth)
{
for (i = 0; i < 3; i++)
{
target_pos[i] = target_pos[i] - (pos_moon[i] /
(1.0 + EM_RATIO));
target_vel[i] = target_vel[i] - (vel_moon[i] /
(1.0 + EM_RATIO));
}
}
else if (center == earth)
{
for (i = 0; i < 3; i++)
{
center_pos[i] = center_pos[i] - (pos_moon[i] /
(1.0 + EM_RATIO));
center_vel[i] = center_vel[i] - (vel_moon[i] /
(1.0 + EM_RATIO));
}
}
/*
Check for Moon as target, or as center.
*/
else if (target == moon)
{
for (i = 0; i < 3; i++)
{
target_pos[i] = (pos_earth[i] - (target_pos[i] /
(1.0 + EM_RATIO))) + target_pos[i];
target_vel[i] = (vel_earth[i] - (target_vel[i] /
(1.0 + EM_RATIO))) + target_vel[i];
}
}
else if (center == moon)
{
for (i = 0; i < 3; i++)
{
center_pos[i] = (pos_earth[i] - (center_pos[i] /
(1.0 + EM_RATIO))) + center_pos[i];
center_vel[i] = (vel_earth[i] - (center_vel[i] /
(1.0 + EM_RATIO))) + center_vel[i];
}
}
/*
Compute position and velocity vectors.
*/
for (i = 0; i < 3; i++)
{
position[i] = target_pos[i] - center_pos[i];
velocity[i] = target_vel[i] - center_vel[i];
}
return 0;
}
/********state */
short int state (double *jed, short int target,
double *target_pos, double *target_vel)
/*
------------------------------------------------------------------------
PURPOSE:
This function reads and interpolates the JPL planetary
ephemeris file.
REFERENCES:
Standish, E.M. and Newhall, X X (1988). "The JPL Export
Planetary Ephemeris"; JPL document dated 17 June 1988.
INPUT
ARGUMENTS:
*jed (double)
2-element Julian date (TDB) at which interpolation is wanted.
Any combination of jed[0]+jed[1] which falls within the time
span on the file is a permissible epoch. See Note 1 below.
target (short int)
The requested body to get data for from the ephemeris file.
The designation of the astronomical bodies is:
0 = Mercury 6 = Uranus
1 = Venus 7 = Neptune
2 = Earth-Moon barycenter 8 = Pluto
3 = Mars 9 = geocentric Moon
4 = Jupiter 10 = Sun
5 = Saturn
OUTPUT
ARGUMENTS:
*target_pos (double)
The barycentric position vector array of the requested object,
in AU.
(If target object is the Moon, then the vector is geocentric.)
*target_vel (double)
The barycentric velocity vector array of the requested object,
in AU/Day.
Both vectors are referenced to the Earth mean equator and
equinox of epoch.
RETURNED
VALUE:
(short int)
0...everything OK.
1...error reading ephemeris file.
2...epoch out of range.
3...target out of range.
GLOBALS
USED:
KM eph_manager.h
EPHFILE eph_manager.h
IPT eph_manager.h
BUFFER eph_manager.h
NRL eph_manager.h
RECORD_LENGTH eph_manager.h
SS eph_manager.h
JPLAU eph_manager.h
FUNCTIONS
CALLED:
split eph_manager.h
fseek stdio.h
fread stdio.h
interpolate eph_manager.h
ephem_close eph_manager.h
VER./DATE/
PROGRAMMER:
V1.0/03-93/WTH (USNO/AA): Convert FORTRAN to C.
V1.1/07-93/WTH (USNO/AA): Update to C standards.
V2.0/07-98/WTH (USNO/AA): Modify to make position and velocity
two distinct vector arrays. Routine set
to compute one state per call.
V2.1/11-07/WKP (USNO/AA): Updated prolog.
V2.2/10-10/WKP (USNO/AA): Renamed function to lowercase to
comply with coding standards.
NOTES:
1. For ease in programming, the user may put the entire epoch in
jed[0] and set jed[1] = 0. For maximum interpolation accuracy,
set jed[0] = the most recent midnight at or before
interpolation epoch, and set jed[1] = fractional part of a day
elapsed between jed[0] and epoch. As an alternative, it may
prove convenient to set jed[0] = some fixed epoch, such as
start of the integration and jed[1] = elapsed interval between
then and epoch.
------------------------------------------------------------------------
*/
{
short int i;
long int nr, rec;
double t[2], aufac = 1.0, jd[4], s;
/*
Check for invalid targets.
*/
if (target < 0 || target > 10)
return 3;
/*
Set units based on value of the 'KM' flag.
*/
if (KM)
t[1] = SS[2] * 86400.0;
else
{
t[1] = SS[2];
aufac = 1.0 / JPLAU;
}
/*
Check epoch.
*/
s = jed[0] - 0.5;
split (s, &jd[0]);
split (jed[1], &jd[2]);
jd[0] += jd[2] + 0.5;
jd[1] += jd[3];
split (jd[1], &jd[2]);
jd[0] += jd[2];
/*
Return error code if date is out of range.
*/
if ((jd[0] < SS[0]) || ((jd[0] + jd[3]) > SS[1]))
return 2;
/*
Calculate record number and relative time interval.
*/
nr = (long int) ((jd[0] - SS[0]) / SS[2]) + 3;
if (jd[0] == SS[1])
nr -= 2;
t[0] = ((jd[0] - ((double) (nr-3) * SS[2] + SS[0])) + jd[3]) / SS[2];
/*
Read correct record if it is not already in memory.
*/
if (nr != NRL)
{
NRL = nr;
rec = (nr - 1) * RECORD_LENGTH;
fseek (EPHFILE, rec, SEEK_SET);
if (!fread (BUFFER, RECORD_LENGTH, 1, EPHFILE))
{
ephem_close ();
return 1;
}
}
/*
Check and interpolate for requested body.
*/
interpolate (&BUFFER[IPT[0][target]-1],t,IPT[1][target],
IPT[2][target], target_pos,target_vel);
for (i = 0; i < 3; i++)
{
target_pos[i] *= aufac;
target_vel[i] *= aufac;
}
return 0;
}
/********interpolate */
void interpolate (double *buf, double *t, long int ncf, long int na,
double *position, double *velocity)
/*
------------------------------------------------------------------------
PURPOSE:
This function differentiates and interpolates a set of
Chebyshev coefficients to give position and velocity.
REFERENCES:
Standish, E.M. and Newhall, X X (1988). "The JPL Export
Planetary Ephemeris"; JPL document dated 17 June 1988.
INPUT
ARGUMENTS:
*buf (double)
Array of Chebyshev coefficients of position.
*t (double)
t[0] is fractional time interval covered by coefficients at
which interpolation is desired (0 <= t[0] <= 1).
t[1] is length of whole interval in input time units.
ncf (long int)
Number of coefficients per component.
na (long int)
Number of sets of coefficients in full array
(i.e., number of sub-intervals in full interval).
OUTPUT
ARGUMENTS:
*position (double)
Position array of requested object.
*velocity (double)
Velocity array of requested object.
RETURNED
VALUE:
None.
GLOBALS
USED:
NP eph_manager.h
NV eph_manager.h
PC eph_manager.h
VC eph_manager.h
TWOT eph_manager.h
FUNCTIONS
CALLED:
fmod math.h
VER./DATE/
PROGRAMMER:
V1.0/03-93/WTH (USNO/AA): Convert FORTRAN to C.
V1.1/07-93/WTH (USNO/AA): Update to C standards.
V1.2/07-98/WTH (USNO/AA): Modify to make position and velocity
two distinct vector arrays.
V1.3/11-07/WKP (USNO/AA): Updated prolog.
V1.4/12-07/WKP (USNO/AA): Changed ncf and na arguments from short
int to long int.
V1.5/10-10/WKP (USNO/AA): Renamed function to lowercase to
comply with coding standards.
NOTES:
None.
------------------------------------------------------------------------
*/
{
long int i, j, k, l;
double dna, dt1, temp, tc, vfac;
/*
Get correct sub-interval number for this set of coefficients and
then get normalized Chebyshev time within that subinterval.
*/
dna = (double) na;
dt1 = (double) ((long int) t[0]);
temp = dna * t[0];
l = (long int) (temp - dt1);
/*
'tc' is the normalized Chebyshev time (-1 <= tc <= 1).
*/
tc = 2.0 * (fmod (temp, 1.0) + dt1) - 1.0;
/*
Check to see whether Chebyshev time has changed, and compute new
polynomial values if it has. (The element PC[1] is the value of
t1[tc] and hence contains the value of 'tc' on the previous call.)
*/
if (tc != PC[1])
{
NP = 2;
NV = 3;
PC[1] = tc;
TWOT = tc + tc;
}
/*
Be sure that at least 'ncf' polynomials have been evaluated and
are stored in the array 'PC'.
*/
if (NP < ncf)
{
for (i = NP; i < ncf; i++)
PC[i] = TWOT * PC[i-1] - PC[i-2];
NP = ncf;
}
/*
Interpolate to get position for each component.
*/
for (i = 0; i < 3; i++)
{
position[i] = 0.0;
for (j = ncf-1; j >= 0; j--)
{
k = j + (i * ncf) + (l * (3 * ncf));
position[i] += PC[j] * buf[k];
}
}
/*
If velocity interpolation is desired, be sure enough derivative
polynomials have been generated and stored.
*/
vfac = (2.0 * dna) / t[1];
VC[2] = 2.0 * TWOT;
if (NV < ncf)
{
for (i = NV; i < ncf; i++)
VC[i] = TWOT * VC[i-1] + PC[i-1] + PC[i-1] - VC[i-2];
NV = ncf;
}
/*
Interpolate to get velocity for each component.
*/
for (i = 0; i < 3; i++)
{
velocity[i] = 0.0;
for (j = ncf-1; j > 0; j--)
{
k = j + (i * ncf) + (l * (3 * ncf));
velocity[i] += VC[j] * buf[k];
}
velocity[i] *= vfac;
}
return;
}
/********split */
void split (double tt,
double *fr)
/*
------------------------------------------------------------------------
PURPOSE:
This function breaks up a double number into a double integer
part and a fractional part.
REFERENCES:
Standish, E.M. and Newhall, X X (1988). "The JPL Export
Planetary Ephemeris"; JPL document dated 17 June 1988.
INPUT
ARGUMENTS:
tt (double)
Input number.
OUTPUT
ARGUMENTS:
*fr (double)
2-element output array;
fr[0] contains integer part,
fr[1] contains fractional part.
For negative input numbers,
fr[0] contains the next more negative integer;
fr[1] contains a positive fraction.
RETURNED
VALUE:
None.
GLOBALS
USED:
None.
FUNCTIONS
CALLED:
None.
VER./DATE/
PROGRAMMER:
V1.0/06-90/JAB (USNO/NA): CA coding standards
V1.1/03-93/WTH (USNO/AA): Convert to C.
V1.2/07-93/WTH (USNO/AA): Update to C standards.
V1.3/10-10/WKP (USNO/AA): Renamed function to lowercase to
comply with coding standards.
NOTES:
None.
------------------------------------------------------------------------
*/
{
/*
Get integer and fractional parts.
*/
fr[0] = (double)((long int) tt);
fr[1] = tt - fr[0];
/*
Make adjustments for negative input number.
*/
if ((tt >= 0.0) || (fr[1] == 0.0))
return;
else
{
fr[0] = fr[0] - 1.0;
fr[1] = fr[1] + 1.0;
}
return;
}
|
ad86a53739c8713fbd711f68735debedd279fcc9
|
a12b448f44beb4d521cb7e31677281f41df35f0b
|
/3rdParty/isl/isl_mat_private.h
|
1a3f69ea4785bafe954860a20fa0c12bb756be9f
|
[
"MIT",
"LGPL-2.0-or-later"
] |
permissive
|
Tiramisu-Compiler/tiramisu
|
d45f65dd9c35f643b3531ec79df1203c7ea3371d
|
f13e480f0ddb142cec371b7d7431a41d8ca885ec
|
refs/heads/master
| 2023-08-25T12:21:26.889736
| 2023-05-09T18:40:52
| 2023-05-09T18:40:52
| 58,378,976
| 906
| 168
|
MIT
| 2023-09-08T11:47:06
| 2016-05-09T13:33:51
|
C++
|
UTF-8
|
C
| false
| false
| 2,402
|
h
|
isl_mat_private.h
|
#include <isl/mat.h>
#include <isl_blk.h>
struct isl_mat {
int ref;
struct isl_ctx *ctx;
#define ISL_MAT_BORROWED (1 << 0)
unsigned flags;
unsigned n_row;
unsigned n_col;
isl_int **row;
/* actual size of the rows in memory; n_col <= max_col */
unsigned max_col;
struct isl_blk block;
};
uint32_t isl_mat_get_hash(__isl_keep isl_mat *mat);
__isl_give isl_mat *isl_mat_zero(isl_ctx *ctx, unsigned n_row, unsigned n_col);
__isl_give isl_mat *isl_mat_dup(__isl_keep isl_mat *mat);
__isl_give isl_mat *isl_mat_cow(__isl_take isl_mat *mat);
__isl_give isl_mat *isl_mat_sub_alloc(__isl_keep isl_mat *mat,
unsigned first_row, unsigned n_row, unsigned first_col, unsigned n_col);
__isl_give isl_mat *isl_mat_sub_alloc6(isl_ctx *ctx, isl_int **row,
unsigned first_row, unsigned n_row, unsigned first_col, unsigned n_col);
void isl_mat_sub_copy(struct isl_ctx *ctx, isl_int **dst, isl_int **src,
unsigned n_row, unsigned dst_col, unsigned src_col, unsigned n_col);
void isl_mat_sub_neg(struct isl_ctx *ctx, isl_int **dst, isl_int **src,
unsigned n_row, unsigned dst_col, unsigned src_col, unsigned n_col);
isl_stat isl_mat_sub_transform(isl_int **row, unsigned n_row,
unsigned first_col, __isl_take isl_mat *mat);
__isl_give isl_mat *isl_mat_diag(isl_ctx *ctx, unsigned n_row, isl_int d);
__isl_give isl_mat *isl_mat_reverse_gauss(__isl_take isl_mat *mat);
__isl_give isl_mat *isl_mat_scale(__isl_take isl_mat *mat, isl_int m);
__isl_give isl_mat *isl_mat_scale_down_row(__isl_take isl_mat *mat, int row,
isl_int m);
__isl_give isl_vec *isl_mat_get_row(__isl_keep isl_mat *mat, unsigned row);
__isl_give isl_mat *isl_mat_lexnonneg_rows(__isl_take isl_mat *mat);
int isl_mat_is_scaled_identity(__isl_keep isl_mat *mat);
isl_stat isl_mat_row_gcd(__isl_keep isl_mat *mat, int row, isl_int *gcd);
void isl_mat_col_mul(struct isl_mat *mat, int dst_col, isl_int f, int src_col);
void isl_mat_col_submul(struct isl_mat *mat,
int dst_col, isl_int f, int src_col);
__isl_give isl_mat *isl_mat_col_addmul(__isl_take isl_mat *mat, int dst_col,
isl_int f, int src_col);
__isl_give isl_mat *isl_mat_col_neg(__isl_take isl_mat *mat, int col);
__isl_give isl_mat *isl_mat_row_neg(__isl_take isl_mat *mat, int row);
int isl_mat_get_element(__isl_keep isl_mat *mat, int row, int col, isl_int *v);
__isl_give isl_mat *isl_mat_set_element(__isl_take isl_mat *mat,
int row, int col, isl_int v);
|
f7c086767f43f93f2af0c4c418951c7f0e764b4c
|
549f66608f0cb4e50cee2e51c53206e798ab82cd
|
/test/Feature/ubsan/ubsan_pointer_overflow-pointer_arithmetic.c
|
c50c788882b366055ea8664464ba59e9e815fccb
|
[
"NCSA"
] |
permissive
|
klee/klee
|
c8da2f9668ee199af47cd2c784cea979017d7704
|
7082eafd05b4f268132ab94772c0243dbebf5087
|
refs/heads/master
| 2023-08-04T08:10:38.619540
| 2023-06-23T21:34:12
| 2023-07-21T09:00:02
| 11,568,417
| 2,339
| 679
|
NOASSERTION
| 2023-09-11T10:23:26
| 2013-07-21T22:03:03
|
C++
|
UTF-8
|
C
| false
| false
| 691
|
c
|
ubsan_pointer_overflow-pointer_arithmetic.c
|
// RUN: %clang %s -fsanitize=pointer-overflow -emit-llvm -g %O0opt -c -o %t.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --output-dir=%t.klee-out --emit-all-errors --ubsan-runtime %t.bc 2>&1 | FileCheck %s
// RUN: ls %t.klee-out/ | grep .ktest | wc -l | grep 2
// RUN: ls %t.klee-out/ | grep .ptr.err | wc -l | grep 1
#include "klee/klee.h"
#include <stdio.h>
int main() {
char c;
char* ptr = &c;
size_t offset;
volatile char* result;
klee_make_symbolic(&offset, sizeof(offset), "offset");
klee_assume((size_t)(ptr) + offset != 0);
// CHECK: KLEE: ERROR: {{.*}}runtime/Sanitizer/ubsan/ubsan_handlers.cpp:{{[0-9]+}}: pointer-overflow
result = ptr + offset;
return 0;
}
|
94920fd3dd62bb65216fb0b3550777b10afdeb34
|
7f6c235b0598353549959c18f69eefd20b766907
|
/include/alloc/balloc.h
|
76b60fe3f80c8c87eae199ad310e3bc2b714bb3c
|
[
"ClArtistic"
] |
permissive
|
z88dk/z88dk
|
46dfd4905f36d99333173cadd0a660839befc9f0
|
8b07f37cc43c5d9ffe69b563c80763491d8faff7
|
refs/heads/master
| 2023-09-04T19:29:49.254958
| 2023-09-03T20:51:24
| 2023-09-03T20:51:24
| 54,035,569
| 820
| 263
|
NOASSERTION
| 2023-09-05T11:09:04
| 2016-03-16T13:48:16
|
Assembly
|
UTF-8
|
C
| false
| false
| 983
|
h
|
balloc.h
|
// automatically generated by m4 from headers in proto subdir
#ifndef __ALLOC_BALLOC_H__
#define __ALLOC_BALLOC_H__
#include <stddef.h>
extern void __LIB__ *balloc_addmem(unsigned char q,size_t num,size_t size,void *p) __smallc;
extern void __LIB__ *balloc_addmem_callee(unsigned char q,size_t num,size_t size,void *p) __smallc __z88dk_callee;
#define balloc_addmem(a,b,c,d) balloc_addmem_callee(a,b,c,d)
extern void __LIB__ *balloc_alloc(unsigned char q) __smallc __z88dk_fastcall;
extern size_t __LIB__ balloc_blockcount(unsigned char q) __smallc __z88dk_fastcall;
extern void __LIB__ *balloc_firstfit(unsigned char q,unsigned char numq) __smallc;
extern void __LIB__ *balloc_firstfit_callee(unsigned char q,unsigned char numq) __smallc __z88dk_callee;
#define balloc_firstfit(a,b) balloc_firstfit_callee(a,b)
extern void __LIB__ balloc_free(void *p) __smallc __z88dk_fastcall;
extern void __LIB__ *balloc_reset(unsigned char q) __smallc __z88dk_fastcall;
#endif
|
4764a76b00c4488e2f058d95e4e3e71edaba9cb5
|
7664f318ed04bd0680f3d82321c18896e3ef6ad5
|
/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c
|
40f8f46bba3b02601721c673361e069a00739fe6
|
[] |
no_license
|
zeldaret/oot
|
9c80ce17f2d8fd61514b375f92ee4739b5ce9d4e
|
2875ab4fcf5c5f81d76353d1ee0024c9ea8d0b23
|
refs/heads/master
| 2023-08-29T05:29:31.356427
| 2023-08-28T22:48:52
| 2023-08-28T22:48:52
| 247,875,738
| 4,401
| 802
| null | 2023-09-14T13:34:38
| 2020-03-17T04:02:19
|
C
|
UTF-8
|
C
| false
| false
| 7,175
|
c
|
z_bg_gnd_soulmeiro.c
|
/*
* File: z_bg_gnd_soulmeiro.c
* Overlay: ovl_Bg_Gnd_Soulmeiro
* Description: Web-Blocked Ceiling Hole (Inside Ganon's Castle)
*/
#include "z_bg_gnd_soulmeiro.h"
#include "assets/objects/object_demo_kekkai/object_demo_kekkai.h"
#include "global.h"
#define FLAGS 0
void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play);
void BgGndSoulmeiro_Destroy(Actor* thisx, PlayState* play);
void BgGndSoulmeiro_Update(Actor* thisx, PlayState* play);
void BgGndSoulmeiro_Draw(Actor* thisx, PlayState* play);
void func_8087AF38(BgGndSoulmeiro* this, PlayState* play);
void func_8087B284(BgGndSoulmeiro* this, PlayState* play);
void func_8087B350(BgGndSoulmeiro* this, PlayState* play);
ActorInit Bg_Gnd_Soulmeiro_InitVars = {
ACTOR_BG_GND_SOULMEIRO,
ACTORCAT_PROP,
FLAGS,
OBJECT_DEMO_KEKKAI,
sizeof(BgGndSoulmeiro),
(ActorFunc)BgGndSoulmeiro_Init,
(ActorFunc)BgGndSoulmeiro_Destroy,
(ActorFunc)BgGndSoulmeiro_Update,
(ActorFunc)BgGndSoulmeiro_Draw,
};
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_TYPE_1,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0xFFCFFFFF, 0x00, 0x00 },
{ 0x00020800, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 50, 20, 20, { 0, 0, 0 } },
};
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) {
s32 pad;
BgGndSoulmeiro* this = (BgGndSoulmeiro*)thisx;
Actor_ProcessInitChain(&this->actor, sInitChain);
this->actionFunc = NULL;
switch (this->actor.params & 0xFF) {
case 0:
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->actionFunc = func_8087B284;
if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) {
Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, 9);
this->actor.draw = NULL;
Actor_Kill(&this->actor);
return;
} else {
this->actor.draw = BgGndSoulmeiro_Draw;
}
break;
case 1:
case 2:
if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) {
this->actor.draw = BgGndSoulmeiro_Draw;
} else {
this->actor.draw = NULL;
}
this->actionFunc = func_8087B350;
break;
}
}
void BgGndSoulmeiro_Destroy(Actor* thisx, PlayState* play) {
BgGndSoulmeiro* this = (BgGndSoulmeiro*)thisx;
if ((this->actor.params & 0xFF) == 0) {
Collider_DestroyCylinder(play, &this->collider);
}
}
void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) {
static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
Vec3f vecA;
Vec3f vecB;
Actor* thisx = &this->actor;
if (this->unk_198 != 0) {
this->unk_198--;
}
if (this->unk_198 == 20) {
Flags_SetSwitch(play, (thisx->params >> 8) & 0x3F);
thisx->draw = NULL;
}
// This should be this->unk_198 == 0, this is required to match
if (!this->unk_198) {
Flags_SetSwitch(play, (thisx->params >> 8) & 0x3F);
Actor_Kill(&this->actor);
Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 0,
0, 0, 9);
} else if ((this->unk_198 % 6) == 0) {
s32 i;
s16 temp_2 = Rand_ZeroOne() * (10922.0f); // This should be: 0x10000 / 6.0f
vecA.y = 0.0f;
vecB.y = thisx->world.pos.y;
for (i = 0; i < 6; i++) {
s16 temp_1 = Rand_CenteredFloat(0x2800) + temp_2;
f32 temp_3 = Math_SinS(temp_1);
f32 temp_4 = Math_CosS(temp_1);
f32 distXZ;
vecB.x = thisx->world.pos.x + (120.0f * temp_3);
vecB.z = thisx->world.pos.z + (120.0f * temp_4);
distXZ = Math_Vec3f_DistXZ(&thisx->home.pos, &vecB) * (1.0f / 120.0f);
if (distXZ < 0.7f) {
temp_3 = Math_SinS(temp_1 + 0x8000);
temp_4 = Math_CosS(temp_1 + 0x8000);
vecB.x = thisx->world.pos.x + (120.0f * temp_3);
vecB.z = thisx->world.pos.z + (120.0f * temp_4);
distXZ = Math_Vec3f_DistXZ(&thisx->home.pos, &vecB) * (1.0f / 120.0f);
}
vecA.x = 4.0f * temp_3 * distXZ;
vecA.y = 0.0f;
vecA.z = 4.0f * temp_4 * distXZ;
EffectSsDeadDb_Spawn(play, &thisx->home.pos, &vecA, &zeroVec, 60, 6, 255, 255, 150, 170, 255, 0, 0, 1, 14,
true);
temp_2 += 0x2AAA;
}
}
}
void func_8087B284(BgGndSoulmeiro* this, PlayState* play) {
s32 pad;
if (!Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) {
this->actor.draw = BgGndSoulmeiro_Draw;
if (this->collider.base.acFlags & AC_HIT) {
Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->unk_198 = 40;
this->actionFunc = func_8087AF38;
} else {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
}
}
void func_8087B350(BgGndSoulmeiro* this, PlayState* play) {
if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) {
this->actor.draw = BgGndSoulmeiro_Draw;
} else {
this->actor.draw = NULL;
}
}
void BgGndSoulmeiro_Update(Actor* thisx, PlayState* play) {
BgGndSoulmeiro* this = (BgGndSoulmeiro*)thisx;
if (this->actionFunc != NULL) {
this->actionFunc(this, play);
}
}
void BgGndSoulmeiro_Draw(Actor* thisx, PlayState* play) {
static Gfx* dLists[] = {
gSpiritTrialWebDL,
gSpiritTrialLightSourceDL,
gSpiritTrialLightFloorDL,
};
s32 params = thisx->params & 0xFF;
if (1) {}
switch (params) {
case 0:
OPEN_DISPS(play->state.gfxCtx, "../z_bg_gnd_soulmeiro.c", 398);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_gnd_soulmeiro.c", 400),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, dLists[params]);
CLOSE_DISPS(play->state.gfxCtx, "../z_bg_gnd_soulmeiro.c", 403);
break;
case 1:
Gfx_DrawDListXlu(play, dLists[params]);
break;
case 2:
Gfx_DrawDListOpa(play, dLists[params]);
break;
}
}
|
e1bf1a88a596eb8603de439243580df34d8c72c0
|
b452bbb87214f174122f425f6f98f4c3890c3cca
|
/internal/ccall/sfdpgen/PriorityQueue.c
|
cc48038261b815010322f49d1808f7cacc9d5b4f
|
[
"MIT"
] |
permissive
|
goccy/go-graphviz
|
bea9bc86b42734aff7ffae283aeae71702ca588a
|
865af036ddbb745c4424bbd2fdaa9a75668cf0d4
|
refs/heads/master
| 2023-07-20T08:05:39.868377
| 2023-03-21T23:49:44
| 2023-03-21T23:49:44
| 236,740,615
| 511
| 66
|
MIT
| 2023-07-07T13:53:28
| 2020-01-28T13:24:09
|
Go
|
UTF-8
|
C
| false
| false
| 5,004
|
c
|
PriorityQueue.c
|
/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************/
#include "LinkedList.h"
#include "PriorityQueue.h"
#include "memory.h"
#include "logic.h"
#include "assert.h"
#include "arith.h"
#define MALLOC gmalloc
#define REALLOC grealloc
#define FREE free
#define MEMCPY memcpy
PriorityQueue PriorityQueue_new(int n, int ngain){
PriorityQueue q;
int i;
q = N_GNEW(1,struct PriorityQueue_struct);
q->count = 0;
q->n = n;
q->ngain = ngain;
q->gain_max = -1;/* no entries yet */
q->buckets = N_GNEW((ngain+1),DoubleLinkedList);
for (i = 0; i < ngain+1; i++) (q->buckets)[i] = NULL;
q->where = N_GNEW((n+1),DoubleLinkedList);
for (i = 0; i < n+1; i++) (q->where)[i] = NULL;
q->gain = N_GNEW((n+1),int);
for (i = 0; i < n+1; i++) (q->gain)[i] = -999;
return q;
}
void PriorityQueue_delete(PriorityQueue q){
int i;
if (q){
if (q->buckets){
for (i = 0; i < q->ngain+1; i++) DoubleLinkedList_delete((q->buckets)[i], free);
FREE(q->buckets);
}
if (q->where){
FREE(q->where);
}
FREE(q->gain);
FREE(q);
}
}
PriorityQueue PriorityQueue_push(PriorityQueue q, int i, int gain){
DoubleLinkedList l;
int *data, gainold;
assert(q);
assert(gain <= q->ngain);
if (!(q->where)[i]){
/* this entry is no in the queue yet, so this is a new addition */
(q->count)++;
if (gain > q->gain_max) q->gain_max = gain;
q->gain[i] = gain;
data = N_GNEW(1,int);
data[0] = i;
if ((l = (q->buckets)[gain])){
(q->buckets)[gain] = (q->where)[i] = DoubleLinkedList_prepend(l, data);
} else {
(q->buckets)[gain] = (q->where)[i] = DoubleLinkedList_new(data);
}
} else {
/* update gain for an exisiting entry */
l = q->where[i];
gainold = q->gain[i];
q->where[i] = NULL;
(q->count)--;
DoubleLinkedList_delete_element(l, free, &((q->buckets)[gainold]));
return PriorityQueue_push(q, i, gain);
}
return q;
}
int PriorityQueue_pop(PriorityQueue q, int *i, int *gain){
int gain_max;
DoubleLinkedList l;
int *data;
if (!q || q->count <= 0) return 0;
*gain = gain_max = q->gain_max;
(q->count)--;
l = (q->buckets)[gain_max];
data = (int*) DoubleLinkedList_get_data(l);
*i = data[0];
DoubleLinkedList_delete_element(l, free, &((q->buckets)[gain_max]));
if (!(q->buckets)[gain_max]){/* the bin that contain the best gain is empty now after poping */
while (gain_max >= 0 && !(q->buckets)[gain_max]) gain_max--;
q->gain_max = gain_max;
}
q->where[*i] = NULL;
q->gain[*i] = -999;
return 1;
}
int PriorityQueue_get_gain(PriorityQueue q, int i){
return q->gain[i];
}
int PriorityQueue_remove(PriorityQueue q, int i){
/* remove an entry from the queue. If error, return 0. */
int gain, gain_max;
DoubleLinkedList l;
if (!q || q->count <= 0) return 0;
gain = q->gain[i];
(q->count)--;
l = (q->where)[i];
DoubleLinkedList_delete_element(l, free, &((q->buckets)[gain]));
if (gain == (gain_max = q->gain_max) && !(q->buckets)[gain_max]){/* the bin that contain the best gain is empty now after poping */
while (gain_max >= 0 && !(q->buckets)[gain_max]) gain_max--;
q->gain_max = gain_max;
}
q->where[i] = NULL;
q->gain[i] = -999;
return 1;
}
/*
main(){
int i, gain;
PriorityQueue q;
q = PriorityQueue_new(10,100);
PriorityQueue_push(q, 3, 1);
PriorityQueue_push(q, 2, 2);
PriorityQueue_push(q, 4, 2);
PriorityQueue_push(q, 5, 2);
PriorityQueue_push(q, 1, 100);
PriorityQueue_push(q, 2, 1);
while (PriorityQueue_pop(q, &i, &gain)){
printf("i = %d gain = %d\n", i, gain);
}
printf("=========\n");
PriorityQueue_push(q, 3, 1);
PriorityQueue_push(q, 2, 2);
PriorityQueue_push(q, 4, 2);
PriorityQueue_push(q, 5, 2);
PriorityQueue_push(q, 1, 100);
PriorityQueue_push(q, 2, 1);
PriorityQueue_push(q, 2, 100);
while (PriorityQueue_pop(q, &i, &gain)){
printf("i = %d gain = %d\n", i, gain);
}
printf("====after removing 3 and 2 =====\n");
PriorityQueue_push(q, 3, 1);
PriorityQueue_push(q, 2, 2);
PriorityQueue_push(q, 4, 2);
PriorityQueue_push(q, 5, 2);
PriorityQueue_push(q, 1, 100);
PriorityQueue_push(q, 2, 1);
PriorityQueue_push(q, 2, 100);
PriorityQueue_remove(q, 3);
PriorityQueue_remove(q, 2);
while (PriorityQueue_pop(q, &i, &gain)){
printf("i = %d gain = %d\n", i, gain);
}
PriorityQueue_delete(q);
}
*/
|
bbeb5bece612366936aaf88b925ea3de262c007a
|
a8b5cf8870c38d7c6b18c9f62cd3ab073f2982c4
|
/tests/testdup.c
|
48343f849736562421ae74e15b6b22625cf8333b
|
[] |
no_license
|
renpy/renpyweb
|
476f4d9a0a40af6689062c80f42ac802f5c4acb3
|
e5bad02dbf3c6fc773c438fbfea99a1151afa843
|
refs/heads/master
| 2023-05-28T05:25:55.307737
| 2023-01-25T16:02:50
| 2023-01-25T16:02:50
| 167,872,620
| 152
| 24
| null | 2022-04-21T02:49:24
| 2019-01-27T23:54:26
|
C
|
UTF-8
|
C
| false
| false
| 1,627
|
c
|
testdup.c
|
/**
* Test case for duplicate click events on touch devices
* https://github.com/emscripten-ports/SDL2/pull/64
*/
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
#include "SDL.h"
static int run = 1;
void loop()
{
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch(event.type) {
case SDL_MOUSEMOTION:
SDL_Log("mousemotion %i\n", event.motion.which);
break;
case SDL_MOUSEBUTTONDOWN:
SDL_Log("mousebuttondown %i\n", event.button.which);
break;
case SDL_MOUSEBUTTONUP:
SDL_Log("mousebuttonup %i\n", event.button.which);
break;
case SDL_FINGERMOTION:
SDL_Log("fingermotion %lli\n", event.tfinger.touchId);
break;
case SDL_FINGERDOWN:
SDL_Log("fingerdown %lli\n", event.tfinger.touchId);
break;
case SDL_FINGERUP:
SDL_Log("fingerup %lli\n", event.tfinger.touchId);
break;
case SDL_QUIT:
run = 0;
break;
}
}
}
int main(int argc, char *argv[])
{
SDL_Window *window;
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
return (1);
}
window = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, 0);
SDL_EventState(SDL_FINGERDOWN, SDL_IGNORE);
SDL_EventState(SDL_FINGERUP, SDL_IGNORE);
SDL_EventState(SDL_FINGERMOTION, SDL_IGNORE);
#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(loop, 0, 1);
#else
while (run) loop();
#endif
return (0);
}
/**
Native Android:
mousemotion -1
mousebuttondown -1
mousebuttonup -1
emscripten SDL2 + Firefox Android:
mousemotion -1
mousebuttondown -1
mousebuttonup -1
mousemotion 0
mousebuttondown 0
mousebuttonup 0
*/
|
46b82054a899b24d81340ba0e240644f87f48db7
|
5eff7a36d9a9917dce9111f0c3074375fe6f7656
|
/app/xenodm/greeter/verify.c
|
99dcdea164171421af2166ec3c3c31a56e1def0d
|
[
"MIT-open-group",
"MIT",
"BSD-3-Clause",
"X11-distribute-modifications-variant",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] |
permissive
|
openbsd/xenocara
|
cb392d02ebba06f6ff7d826fd8a89aa3b8401779
|
a012b5de33ea0b977095d77316a521195b26cc6b
|
refs/heads/master
| 2023-08-25T12:16:58.862008
| 2023-08-12T16:16:25
| 2023-08-12T16:16:25
| 66,967,384
| 177
| 66
| null | 2023-07-22T18:12:37
| 2016-08-30T18:36:01
|
C
|
UTF-8
|
C
| false
| false
| 6,819
|
c
|
verify.c
|
/*
Copyright 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
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 OPEN GROUP 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 of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/*
* xdm - display manager daemon
* Author: Keith Packard, MIT X Consortium
*
* verify.c
*
* typical unix verification routine.
*/
#include "dm.h"
#include "dm_error.h"
#include "Login.h"
#include <pwd.h>
#include <login_cap.h>
#include <stdarg.h>
#include <bsd_auth.h>
#include <vis.h>
#include "greet.h"
static const char *envvars[] = {
"TZ", /* SYSV and SVR4, but never hurts */
NULL
};
static char **
userEnv (struct display *d, int useSystemPath, char *user, char *home, char *shell)
{
char **env;
const char **envvar;
const char *str;
env = defaultEnv (NULL);
env = setEnv (env, "DISPLAY", d->name);
env = setEnv (env, "HOME", home);
env = setEnv (env, "LOGNAME", user); /* POSIX, System V */
env = setEnv (env, "USER", user); /* BSD */
env = setEnv (env, "PATH", useSystemPath ? d->systemPath : d->userPath);
env = setEnv (env, "SHELL", shell);
for (envvar = envvars; *envvar; envvar++)
{
str = getenv(*envvar);
if (str)
env = setEnv (env, *envvar, str);
}
return env;
}
_X_INTERNAL
int
Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
{
struct passwd *p;
login_cap_t *lc;
auth_session_t *as;
char *style, *shell, *home, *s, **argv;
char path[MAXPATHLEN];
int authok;
size_t passwd_len;
char visname[NAME_LEN*4];
/* User may have specified an authentication style. */
if ((style = strchr(greet->name, ':')) != NULL)
*style++ = '\0';
strvis(visname, greet->name, 0);
Debug ("Verify %s, style %s ...\n", visname,
style ? style : "default");
explicit_bzero(visname, NAME_LEN*4);
p = getpwnam (greet->name);
if (!p || strlen (greet->name) == 0) {
Debug("getpwnam() failed.\n");
explicit_bzero(greet->password, strlen(greet->password));
return 0;
}
if ((lc = login_getclass(p->pw_class)) == NULL) {
Debug("login_getclass() failed.\n");
explicit_bzero(greet->password, strlen(greet->password));
return 0;
}
if ((style = login_getstyle(lc, style, "xdm")) == NULL) {
Debug("login_getstyle() failed.\n");
explicit_bzero(greet->password, strlen(greet->password));
return 0;
}
if ((as = auth_open()) == NULL) {
Debug("auth_open() failed.\n");
login_close(lc);
explicit_bzero(greet->password, strlen(greet->password));
return 0;
}
if (auth_setoption(as, "login", "yes") == -1) {
Debug("auth_setoption() failed.\n");
login_close(lc);
explicit_bzero(greet->password, strlen(greet->password));
return 0;
}
passwd_len = strlen(greet->password);
/* Set up state for no challenge, just check a response. */
auth_setstate(as, 0);
auth_setdata(as, "", 1);
auth_setdata(as, greet->password, passwd_len + 1);
/* wipe password now, otherwise it'll be copied fork() in auth_call */
explicit_bzero(greet->password, passwd_len);
/* Build path of the auth script and call it */
snprintf(path, sizeof(path), _PATH_AUTHPROG "%s", style);
auth_call(as, path, style, "-s", "response", "--", greet->name,
lc->lc_class, (void *)NULL);
authok = auth_getstate(as);
if ((authok & AUTH_ALLOW) == 0) {
Debug("password verify failed\n");
auth_close(as);
login_close(lc);
return 0;
}
/* Run the approval script */
if (!auth_approval(as, lc, greet->name, "auth-xdm")) {
Debug("login not approved\n");
auth_close(as);
login_close(lc);
return 0;
}
auth_close(as);
login_close(lc);
/* Check empty passwords against allowNullPasswd */
if (!greet->allow_null_passwd && passwd_len == 0) {
Debug("empty password not allowed\n");
return 0;
}
/* Only accept root logins if allowRootLogin resource is set */
if (p->pw_uid == 0 && !greet->allow_root_login) {
Debug("root logins not allowed\n");
return 0;
}
/*
* Shell must be in /etc/shells
*/
for (;;) {
s = getusershell();
if (s == NULL) {
/* did not found the shell in /etc/shells
-> failure */
Debug("shell not in /etc/shells\n");
endusershell();
return 0;
}
if (strcmp(s, p->pw_shell) == 0) {
/* found the shell in /etc/shells */
endusershell();
break;
}
}
Debug ("verify succeeded\n");
verify->uid = p->pw_uid;
verify->gid = p->pw_gid;
home = p->pw_dir;
shell = p->pw_shell;
argv = NULL;
if (d->session)
argv = parseArgs (argv, d->session);
if (greet->string)
argv = parseArgs (argv, greet->string);
if (!argv)
argv = parseArgs (argv, "xsession");
verify->argv = argv;
verify->userEnviron = userEnv (d, p->pw_uid == 0,
greet->name, home, shell);
Debug ("user environment:\n");
printEnv (verify->userEnviron);
verify->systemEnviron = systemEnv (d, greet->name, home);
Debug ("system environment:\n");
printEnv (verify->systemEnviron);
Debug ("end of environments\n");
return 1;
}
_X_INTERNAL
int
autoLoginEnv(struct display *d, struct verify_info *verify,
struct greet_info *greet)
{
struct passwd *p;
char *shell, *home, **argv;
Debug("Autologin %s\n", d->autoLogin);
p = getpwnam (d->autoLogin);
if (p == NULL)
return 0;
greet->name = strdup(d->autoLogin);
if (greet->name == NULL)
return 0;
verify->uid = p->pw_uid;
verify->gid = p->pw_gid;
home = p->pw_dir;
shell = p->pw_shell;
argv = NULL;
if (d->session)
argv = parseArgs (argv, d->session);
if (greet->string)
argv = parseArgs (argv, greet->string);
if (!argv)
argv = parseArgs (argv, "xsession");
verify->argv = argv;
verify->userEnviron = userEnv (d, p->pw_uid == 0,
greet->name, home, shell);
Debug ("user environment:\n");
printEnv (verify->userEnviron);
verify->systemEnviron = systemEnv (d, greet->name, home);
Debug ("system environment:\n");
printEnv (verify->systemEnviron);
Debug ("end of environments\n");
return 1;
}
|
76ead3394f683783485c80f716c44e3e7ee5ad52
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/imxrt/libraries/MIMXRT1064/MIMXRT1064/drivers/fsl_enc.c
|
a6fce304758078af89e5d56f3a54bb063a4ad683
|
[
"Apache-2.0",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 14,385
|
c
|
fsl_enc.c
|
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* Copyright 2016-2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "fsl_enc.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/* Component ID definition, used by tools. */
#ifndef FSL_COMPONENT_ID
#define FSL_COMPONENT_ID "platform.drivers.enc"
#endif
#define ENC_CTRL_W1C_FLAGS (ENC_CTRL_HIRQ_MASK | ENC_CTRL_XIRQ_MASK | ENC_CTRL_DIRQ_MASK | ENC_CTRL_CMPIRQ_MASK)
#define ENC_CTRL2_W1C_FLAGS (ENC_CTRL2_SABIRQ_MASK | ENC_CTRL2_ROIRQ_MASK | ENC_CTRL2_RUIRQ_MASK)
/*******************************************************************************
* Prototypes
******************************************************************************/
/*!
* @brief Get instance number for ENC module.
*
* @param base ENC peripheral base address
*/
static uint32_t ENC_GetInstance(ENC_Type *base);
/*******************************************************************************
* Variables
******************************************************************************/
/*! @brief Pointers to ENC bases for each instance. */
static ENC_Type *const s_encBases[] = ENC_BASE_PTRS;
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
/*! @brief Pointers to ENC clocks for each instance. */
static const clock_ip_name_t s_encClocks[] = ENC_CLOCKS;
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
/*******************************************************************************
* Code
******************************************************************************/
static uint32_t ENC_GetInstance(ENC_Type *base)
{
uint32_t instance;
/* Find the instance index from base address mappings. */
for (instance = 0; instance < ARRAY_SIZE(s_encBases); instance++)
{
if (s_encBases[instance] == base)
{
break;
}
}
assert(instance < ARRAY_SIZE(s_encBases));
return instance;
}
void ENC_Init(ENC_Type *base, const enc_config_t *config)
{
assert(NULL != config);
uint32_t tmp16;
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
/* Enable the clock. */
CLOCK_EnableClock(s_encClocks[ENC_GetInstance(base)]);
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
/* ENC_CTRL. */
tmp16 = base->CTRL & (uint16_t)(~(ENC_CTRL_W1C_FLAGS | ENC_CTRL_HIP_MASK | ENC_CTRL_HNE_MASK | ENC_CTRL_REV_MASK |
ENC_CTRL_PH1_MASK | ENC_CTRL_XIP_MASK | ENC_CTRL_XNE_MASK | ENC_CTRL_WDE_MASK));
/* For HOME trigger. */
if (kENC_HOMETriggerDisabled != config->HOMETriggerMode)
{
tmp16 |= ENC_CTRL_HIP_MASK;
if (kENC_HOMETriggerOnFallingEdge == config->HOMETriggerMode)
{
tmp16 |= ENC_CTRL_HNE_MASK;
}
}
/* For encoder work mode. */
if (config->enableReverseDirection)
{
tmp16 |= ENC_CTRL_REV_MASK;
}
if (kENC_DecoderWorkAsSignalPhaseCountMode == config->decoderWorkMode)
{
tmp16 |= ENC_CTRL_PH1_MASK;
}
/* For INDEX trigger. */
if (kENC_INDEXTriggerDisabled != config->INDEXTriggerMode)
{
tmp16 |= ENC_CTRL_XIP_MASK;
if (kENC_INDEXTriggerOnFallingEdge == config->INDEXTriggerMode)
{
tmp16 |= ENC_CTRL_XNE_MASK;
}
}
/* Watchdog. */
if (config->enableWatchdog)
{
tmp16 |= ENC_CTRL_WDE_MASK;
base->WTR = config->watchdogTimeoutValue; /* WDOG can be only available when the feature is enabled. */
}
base->CTRL = tmp16;
/* ENC_FILT. */
base->FILT = ENC_FILT_FILT_CNT(config->filterCount) | ENC_FILT_FILT_PER(config->filterSamplePeriod);
/* ENC_CTRL2. */
tmp16 = base->CTRL2 & (uint16_t)(~(ENC_CTRL2_W1C_FLAGS | ENC_CTRL2_OUTCTL_MASK | ENC_CTRL2_REVMOD_MASK |
ENC_CTRL2_MOD_MASK | ENC_CTRL2_UPDPOS_MASK | ENC_CTRL2_UPDHLD_MASK));
if (kENC_POSMATCHOnReadingAnyPositionCounter == config->positionMatchMode)
{
tmp16 |= ENC_CTRL2_OUTCTL_MASK;
}
if (kENC_RevolutionCountOnRollOverModulus == config->revolutionCountCondition)
{
tmp16 |= ENC_CTRL2_REVMOD_MASK;
}
if (config->enableModuloCountMode)
{
tmp16 |= ENC_CTRL2_MOD_MASK;
/* Set modulus value. */
base->UMOD = (uint16_t)(config->positionModulusValue >> 16U); /* Upper 16 bits. */
base->LMOD = (uint16_t)(config->positionModulusValue); /* Lower 16 bits. */
}
if (config->enableTRIGGERClearPositionCounter)
{
tmp16 |= ENC_CTRL2_UPDPOS_MASK;
}
if (config->enableTRIGGERClearHoldPositionCounter)
{
tmp16 |= ENC_CTRL2_UPDHLD_MASK;
}
base->CTRL2 = tmp16;
/* ENC_UCOMP & ENC_LCOMP. */
base->UCOMP = (uint16_t)(config->positionCompareValue >> 16U); /* Upper 16 bits. */
base->LCOMP = (uint16_t)(config->positionCompareValue); /* Lower 16 bits. */
/* ENC_UINIT & ENC_LINIT. */
base->UINIT = (uint16_t)(config->positionInitialValue >> 16U); /* Upper 16 bits. */
base->LINIT = (uint16_t)(config->positionInitialValue); /* Lower 16 bits. */
}
void ENC_Deinit(ENC_Type *base)
{
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
/* Disable the clock. */
CLOCK_DisableClock(s_encClocks[ENC_GetInstance(base)]);
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
}
void ENC_GetDefaultConfig(enc_config_t *config)
{
assert(NULL != config);
config->enableReverseDirection = false;
config->decoderWorkMode = kENC_DecoderWorkAsNormalMode;
config->HOMETriggerMode = kENC_HOMETriggerDisabled;
config->INDEXTriggerMode = kENC_INDEXTriggerDisabled;
config->enableTRIGGERClearPositionCounter = false;
config->enableTRIGGERClearHoldPositionCounter = false;
config->enableWatchdog = false;
config->watchdogTimeoutValue = 0U;
config->filterCount = 0U;
config->filterSamplePeriod = 0U;
config->positionMatchMode = kENC_POSMATCHOnPositionCounterEqualToComapreValue;
config->positionCompareValue = 0xFFFFFFFFU;
config->revolutionCountCondition = kENC_RevolutionCountOnINDEXPulse;
config->enableModuloCountMode = false;
config->positionModulusValue = 0U;
config->positionInitialValue = 0U;
}
void ENC_DoSoftwareLoadInitialPositionValue(ENC_Type *base)
{
uint16_t tmp16 = base->CTRL & (uint16_t)(~ENC_CTRL_W1C_FLAGS);
tmp16 |= ENC_CTRL_SWIP_MASK; /* Write 1 to trigger the command for loading initial position value. */
base->CTRL = tmp16;
}
void ENC_SetSelfTestConfig(ENC_Type *base, const enc_self_test_config_t *config)
{
uint16_t tmp16 = 0U;
if (NULL == config) /* Pass "NULL" to disable the feature. */
{
base->TST = 0U;
return;
}
tmp16 = ENC_TST_TEN_MASK | ENC_TST_TCE_MASK | ENC_TST_TEST_PERIOD(config->signalPeriod) |
ENC_TST_TEST_COUNT(config->signalCount);
if (kENC_SelfTestDirectionNegative == config->signalDirection)
{
tmp16 |= ENC_TST_QDN_MASK;
}
base->TST = tmp16;
}
void ENC_EnableWatchdog(ENC_Type *base, bool enable)
{
uint16_t tmp16 = base->CTRL & (uint16_t)(~(ENC_CTRL_W1C_FLAGS | ENC_CTRL_WDE_MASK));
if (enable)
{
tmp16 |= ENC_CTRL_WDE_MASK;
}
base->CTRL = tmp16;
}
uint32_t ENC_GetStatusFlags(ENC_Type *base)
{
uint32_t ret32 = 0U;
/* ENC_CTRL. */
if (ENC_CTRL_HIRQ_MASK == (ENC_CTRL_HIRQ_MASK & base->CTRL))
{
ret32 |= kENC_HOMETransitionFlag;
}
if (ENC_CTRL_XIRQ_MASK == (ENC_CTRL_XIRQ_MASK & base->CTRL))
{
ret32 |= kENC_INDEXPulseFlag;
}
if (ENC_CTRL_DIRQ_MASK == (ENC_CTRL_DIRQ_MASK & base->CTRL))
{
ret32 |= kENC_WatchdogTimeoutFlag;
}
if (ENC_CTRL_CMPIRQ_MASK == (ENC_CTRL_CMPIRQ_MASK & base->CTRL))
{
ret32 |= kENC_PositionCompareFlag;
}
/* ENC_CTRL2. */
if (ENC_CTRL2_SABIRQ_MASK == (ENC_CTRL2_SABIRQ_MASK & base->CTRL2))
{
ret32 |= kENC_SimultBothPhaseChangeFlag;
}
if (ENC_CTRL2_ROIRQ_MASK == (ENC_CTRL2_ROIRQ_MASK & base->CTRL2))
{
ret32 |= kENC_PositionRollOverFlag;
}
if (ENC_CTRL2_RUIRQ_MASK == (ENC_CTRL2_RUIRQ_MASK & base->CTRL2))
{
ret32 |= kENC_PositionRollUnderFlag;
}
if (ENC_CTRL2_DIR_MASK == (ENC_CTRL2_DIR_MASK & base->CTRL2))
{
ret32 |= kENC_LastCountDirectionFlag;
}
return ret32;
}
void ENC_ClearStatusFlags(ENC_Type *base, uint32_t mask)
{
uint32_t tmp16 = 0U;
/* ENC_CTRL. */
if (kENC_HOMETransitionFlag == (kENC_HOMETransitionFlag & mask))
{
tmp16 |= ENC_CTRL_HIRQ_MASK;
}
if (kENC_INDEXPulseFlag == (kENC_INDEXPulseFlag & mask))
{
tmp16 |= ENC_CTRL_XIRQ_MASK;
}
if (kENC_WatchdogTimeoutFlag == (kENC_WatchdogTimeoutFlag & mask))
{
tmp16 |= ENC_CTRL_DIRQ_MASK;
}
if (kENC_PositionCompareFlag == (kENC_PositionCompareFlag & mask))
{
tmp16 |= ENC_CTRL_CMPIRQ_MASK;
}
if (0U != tmp16)
{
base->CTRL = (base->CTRL & (uint16_t)(~ENC_CTRL_W1C_FLAGS)) | tmp16;
}
/* ENC_CTRL2. */
tmp16 = 0U;
if (kENC_SimultBothPhaseChangeFlag == (kENC_SimultBothPhaseChangeFlag & mask))
{
tmp16 |= ENC_CTRL2_SABIRQ_MASK;
}
if (kENC_PositionRollOverFlag == (kENC_PositionRollOverFlag & mask))
{
tmp16 |= ENC_CTRL2_ROIRQ_MASK;
}
if (kENC_PositionRollUnderFlag == (kENC_PositionRollUnderFlag & mask))
{
tmp16 |= ENC_CTRL2_RUIRQ_MASK;
}
if (0U != tmp16)
{
base->CTRL2 = (base->CTRL2 & (uint16_t)(~ENC_CTRL2_W1C_FLAGS)) | tmp16;
}
}
void ENC_EnableInterrupts(ENC_Type *base, uint32_t mask)
{
uint32_t tmp16 = 0U;
/* ENC_CTRL. */
if (kENC_HOMETransitionInterruptEnable == (kENC_HOMETransitionInterruptEnable & mask))
{
tmp16 |= ENC_CTRL_HIE_MASK;
}
if (kENC_INDEXPulseInterruptEnable == (kENC_INDEXPulseInterruptEnable & mask))
{
tmp16 |= ENC_CTRL_XIE_MASK;
}
if (kENC_WatchdogTimeoutInterruptEnable == (kENC_WatchdogTimeoutInterruptEnable & mask))
{
tmp16 |= ENC_CTRL_DIE_MASK;
}
if (kENC_PositionCompareInerruptEnable == (kENC_PositionCompareInerruptEnable & mask))
{
tmp16 |= ENC_CTRL_CMPIE_MASK;
}
if (tmp16 != 0U)
{
base->CTRL = (base->CTRL & (uint16_t)(~ENC_CTRL_W1C_FLAGS)) | tmp16;
}
/* ENC_CTRL2. */
tmp16 = 0U;
if (kENC_SimultBothPhaseChangeInterruptEnable == (kENC_SimultBothPhaseChangeInterruptEnable & mask))
{
tmp16 |= ENC_CTRL2_SABIE_MASK;
}
if (kENC_PositionRollOverInterruptEnable == (kENC_PositionRollOverInterruptEnable & mask))
{
tmp16 |= ENC_CTRL2_ROIE_MASK;
}
if (kENC_PositionRollUnderInterruptEnable == (kENC_PositionRollUnderInterruptEnable & mask))
{
tmp16 |= ENC_CTRL2_RUIE_MASK;
}
if (tmp16 != 0U)
{
base->CTRL2 = (base->CTRL2 & (uint16_t)(~ENC_CTRL2_W1C_FLAGS)) | tmp16;
}
}
void ENC_DisableInterrupts(ENC_Type *base, uint32_t mask)
{
uint16_t tmp16 = 0U;
/* ENC_CTRL. */
if (kENC_HOMETransitionInterruptEnable == (kENC_HOMETransitionInterruptEnable & mask))
{
tmp16 |= ENC_CTRL_HIE_MASK;
}
if (kENC_INDEXPulseInterruptEnable == (kENC_INDEXPulseInterruptEnable & mask))
{
tmp16 |= ENC_CTRL_XIE_MASK;
}
if (kENC_WatchdogTimeoutInterruptEnable == (kENC_WatchdogTimeoutInterruptEnable & mask))
{
tmp16 |= ENC_CTRL_DIE_MASK;
}
if (kENC_PositionCompareInerruptEnable == (kENC_PositionCompareInerruptEnable & mask))
{
tmp16 |= ENC_CTRL_CMPIE_MASK;
}
if (0U != tmp16)
{
base->CTRL = (uint16_t)(base->CTRL & (uint16_t)(~ENC_CTRL_W1C_FLAGS)) & (uint16_t)(~tmp16);
}
/* ENC_CTRL2. */
tmp16 = 0U;
if (kENC_SimultBothPhaseChangeInterruptEnable == (kENC_SimultBothPhaseChangeInterruptEnable & mask))
{
tmp16 |= ENC_CTRL2_SABIE_MASK;
}
if (kENC_PositionRollOverInterruptEnable == (kENC_PositionRollOverInterruptEnable & mask))
{
tmp16 |= ENC_CTRL2_ROIE_MASK;
}
if (kENC_PositionRollUnderInterruptEnable == (kENC_PositionRollUnderInterruptEnable & mask))
{
tmp16 |= ENC_CTRL2_RUIE_MASK;
}
if (tmp16 != 0U)
{
base->CTRL2 = (uint16_t)(base->CTRL2 & (uint16_t)(~ENC_CTRL2_W1C_FLAGS)) & (uint16_t)(~tmp16);
}
}
uint32_t ENC_GetEnabledInterrupts(ENC_Type *base)
{
uint32_t ret32 = 0U;
/* ENC_CTRL. */
if (ENC_CTRL_HIE_MASK == (ENC_CTRL_HIE_MASK & base->CTRL))
{
ret32 |= kENC_HOMETransitionInterruptEnable;
}
if (ENC_CTRL_XIE_MASK == (ENC_CTRL_XIE_MASK & base->CTRL))
{
ret32 |= kENC_INDEXPulseInterruptEnable;
}
if (ENC_CTRL_DIE_MASK == (ENC_CTRL_DIE_MASK & base->CTRL))
{
ret32 |= kENC_WatchdogTimeoutInterruptEnable;
}
if (ENC_CTRL_CMPIE_MASK == (ENC_CTRL_CMPIE_MASK & base->CTRL))
{
ret32 |= kENC_PositionCompareInerruptEnable;
}
/* ENC_CTRL2. */
if (ENC_CTRL2_SABIE_MASK == (ENC_CTRL2_SABIE_MASK & base->CTRL2))
{
ret32 |= kENC_SimultBothPhaseChangeInterruptEnable;
}
if (ENC_CTRL2_ROIE_MASK == (ENC_CTRL2_ROIE_MASK & base->CTRL2))
{
ret32 |= kENC_PositionRollOverInterruptEnable;
}
if (ENC_CTRL2_RUIE_MASK == (ENC_CTRL2_RUIE_MASK & base->CTRL2))
{
ret32 |= kENC_PositionRollUnderInterruptEnable;
}
return ret32;
}
void ENC_SetInitialPositionValue(ENC_Type *base, uint32_t value)
{
base->UINIT = (uint16_t)(value >> 16U); /* Set upper 16 bits. */
base->LINIT = (uint16_t)(value); /* Set lower 16 bits. */
}
uint32_t ENC_GetPositionValue(ENC_Type *base)
{
uint32_t ret32;
ret32 = base->UPOS; /* Get upper 16 bits and make a snapshot. */
ret32 <<= 16U;
ret32 |= base->LPOSH; /* Get lower 16 bits from hold register. */
return ret32;
}
uint32_t ENC_GetHoldPositionValue(ENC_Type *base)
{
uint32_t ret32;
ret32 = base->UPOSH; /* Get upper 16 bits and make a snapshot. */
ret32 <<= 16U;
ret32 |= base->LPOSH; /* Get lower 16 bits from hold register. */
return ret32;
}
|
a203689087a6430dc1434e711896b031e6e55641
|
6832a9c81b16ead373325f70fb97753d6a211539
|
/src/wrapped/generated/wrappedgio2defs.h
|
5ab8c78df837ceaf50895c705e13149257894b37
|
[
"MIT"
] |
permissive
|
ptitSeb/box86
|
2d3a0c4574905ff8d9dc7b5afb5444a273832bd6
|
ad934455c1b40feeebe5e6bd09b9063519102859
|
refs/heads/master
| 2023-08-22T05:30:54.331500
| 2023-08-20T13:01:58
| 2023-08-20T13:01:58
| 164,844,546
| 2,877
| 294
|
MIT
| 2023-07-27T11:19:10
| 2019-01-09T10:49:32
|
C
|
UTF-8
|
C
| false
| false
| 299
|
h
|
wrappedgio2defs.h
|
/*******************************************************************
* File automatically generated by rebuild_wrappers.py (v2.0.0.11) *
*******************************************************************/
#ifndef __wrappedgio2DEFS_H_
#define __wrappedgio2DEFS_H_
#endif // __wrappedgio2DEFS_H_
|
c06081960a472fadb98febf768f622c133ce81e6
|
88ae8695987ada722184307301e221e1ba3cc2fa
|
/third_party/wayland-protocols/gtk/testsuite/gdk/pixbuf.c
|
62d68c3a7737f03444c450ee75d4a2b6e8cecba2
|
[
"LGPL-2.0-only",
"Apache-2.0",
"LGPL-2.1-only",
"LGPL-2.0-or-later",
"MIT",
"GPL-1.0-or-later",
"BSD-3-Clause"
] |
permissive
|
iridium-browser/iridium-browser
|
71d9c5ff76e014e6900b825f67389ab0ccd01329
|
5ee297f53dc7f8e70183031cff62f37b0f19d25f
|
refs/heads/master
| 2023-08-03T16:44:16.844552
| 2023-07-20T15:17:00
| 2023-07-23T16:09:30
| 220,016,632
| 341
| 40
|
BSD-3-Clause
| 2021-08-13T13:54:45
| 2019-11-06T14:32:31
| null |
UTF-8
|
C
| false
| false
| 746
|
c
|
pixbuf.c
|
#include <gdk-pixbuf/gdk-pixbuf.h>
static void
test_format (gconstpointer d)
{
const char *f = d;
GSList *formats;
gboolean found;
found = FALSE;
formats = gdk_pixbuf_get_formats ();
for (GSList *l = formats; l && !found; l = l->next)
{
GdkPixbufFormat *format = l->data;
char *name;
name = gdk_pixbuf_format_get_name (format);
if (strcmp (name, f) == 0)
found = TRUE;
g_free (name);
}
g_slist_free (formats);
g_assert_true (found);
}
int
main (int argc, char *argv[])
{
(g_test_init) (&argc, &argv, NULL);
g_test_add_data_func ("/pixbuf/format/png", "png", test_format);
g_test_add_data_func ("/pixbuf/format/jpeg", "jpeg", test_format);
return g_test_run ();
}
|
faa249298cc566cdc3d429f14342c83e1f4c9863
|
376e1818d427b5e4d32fa6dd6c7b71e9fd88afdb
|
/wm/afterstep/patches/patch-libAfterStep_parser.c
|
18a3501a4c13e037d5dda3b9b20457590465a3c7
|
[] |
no_license
|
NetBSD/pkgsrc
|
a0732c023519650ef821ab89c23ab6ab59e25bdb
|
d042034ec4896cc5b47ed6f2e5b8802d9bc5c556
|
refs/heads/trunk
| 2023-09-01T07:40:12.138283
| 2023-09-01T05:25:19
| 2023-09-01T05:25:19
| 88,439,572
| 321
| 138
| null | 2023-07-12T22:34:14
| 2017-04-16T20:04:15
| null |
UTF-8
|
C
| false
| false
| 3,878
|
c
|
patch-libAfterStep_parser.c
|
$NetBSD: patch-libAfterStep_parser.c,v 1.2 2021/07/11 12:13:17 bsiegert Exp $
Use ctype.h correctly.
--- libAfterStep/parser.c.orig 2013-05-01 13:34:11.000000000 +0000
+++ libAfterStep/parser.c
@@ -602,9 +602,9 @@ char *GetNextStatement (ConfigDef * conf
if (*cur == file_terminator)
return NULL;
#ifdef __CYGWIN__
- if (!isspace ((int)*cur) && *cur != 0x0D)
+ if (!isspace ((unsigned char)*cur) && *cur != 0x0D)
#else
- if (!isspace ((int)*cur))
+ if (!isspace ((unsigned char)*cur))
#endif
{
register int i;
@@ -619,7 +619,7 @@ char *GetNextStatement (ConfigDef * conf
if (i == DISABLED_KEYWORD_SIZE) { /* comments - skip entire line */
config->current_flags |= CF_DISABLED_OPTION;
/* let's skip few spaces here */
- while (isspace ((int)cur[i]) && cur[i] != terminator)
+ while (isspace ((unsigned char)cur[i]) && cur[i] != terminator)
++i;
if (cur[i] == '\0' || cur[i] == terminator)
break; /* not a valid option */
@@ -634,7 +634,7 @@ char *GetNextStatement (ConfigDef * conf
print_trimmed_str ("private option at", cur);
++cur;
for (i = 0; mname[i] != '\0' && cur[i] != '\0'; ++i)
- if (tolower (mname[i]) != tolower (cur[i]))
+ if (tolower ((unsigned char)mname[i]) != tolower ((unsigned char)cur[i]))
break;
if (mname[i] != '\0') { /* that was a foreign optiion - belongs to the other executable */
if (get_flags (config->flags, CP_IgnoreForeign))
@@ -657,10 +657,10 @@ char *GetNextStatement (ConfigDef * conf
config->current_data and set current_data_len ; (unless its a comment) */
if (*cur != COMMENTS_CHAR) {
i = 0;
- while (cur[i] && !isspace ((int)cur[i]) && cur[i] != terminator
+ while (cur[i] && !isspace ((unsigned char)cur[i]) && cur[i] != terminator
&& cur[i] != file_terminator)
++i;
- while (isspace ((int)cur[i]) && cur[i] != terminator
+ while (isspace ((unsigned char)cur[i]) && cur[i] != terminator
&& cur[i] != file_terminator)
++i;
} else
@@ -697,7 +697,7 @@ char *GetNextStatement (ConfigDef * conf
while (--i >= 0) {
if (config->tdata[i] == file_terminator)
set_flags (config->current_flags, CF_LAST_OPTION);
- if (!isspace ((int)data[i]))
+ if (!isspace ((unsigned char)data[i]))
break;
}
i++;
@@ -741,10 +741,10 @@ TermDef *FindStatementTerm (char *tline,
if (tline[0] == COMMENTS_CHAR)
return &_as_comments_term;
- if (isspace (tline[0])) {
+ if (isspace ((unsigned char)tline[0])) {
int i = 0;
- while (isspace (tline[i]))
+ while (isspace ((unsigned char)tline[i]))
++i;
if (tline[i] == '~')
if (get_hash_item
@@ -786,7 +786,7 @@ int config2tree_storage (ConfigDef * con
++i; /* it's ok - we can start with 1, since myname should have at least 1 char */
pterm = FindStatementTerm (&(config->tline[i]), config->syntax);
}
- while (pterm == NULL && !isspace (config->tline[i])
+ while (pterm == NULL && !isspace ((unsigned char)config->tline[i])
&& config->tline[i] != '\0');
} else
pterm = FindStatementTerm (config->tline, config->syntax);
@@ -798,7 +798,7 @@ int config2tree_storage (ConfigDef * con
config->current_term = pterm;
LOCAL_DEBUG_OUT ("Term:[%s]", config->current_term->keyword);
- if (isspace (config->tline[0]) && pterm->keyword_len > 0 && mystrncasecmp (pterm->keyword, config->current_data, pterm->keyword_len) == 0) { /* we need to skip one token in current_data : */
+ if (isspace ((unsigned char)config->tline[0]) && pterm->keyword_len > 0 && mystrncasecmp (pterm->keyword, config->current_data, pterm->keyword_len) == 0) { /* we need to skip one token in current_data : */
char *src = tokenskip (config->current_data, 1);
char *dst = config->current_data;
|
e3b3d667190c82d58490ab98352e868fa1ef95cc
|
cf35a104dabc3d3647df66aff9db32d18b002e1b
|
/lib/libstuff/util/closeexec.c
|
bc02e58bd8328deef5e38a4d706e582d4b8e1047
|
[
"MIT"
] |
permissive
|
0intro/wmii
|
ba2dff4be1a049c7d4475218a914585a3f810ab5
|
024f29d1058b58aa4ee6b956500a78f69355fb53
|
refs/heads/main
| 2023-07-11T18:08:43.660898
| 2023-06-25T18:57:45
| 2023-06-25T18:57:45
| 74,551,919
| 110
| 17
| null | null | null | null |
UTF-8
|
C
| false
| false
| 280
|
c
|
closeexec.c
|
/* Copyright ©2008-2010 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include <unistd.h>
#include <fcntl.h>
#include "util.h"
void
closeexec(int fd) {
if(fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
fatal("can't set %d close on exec: %r", fd);
}
|
e25e48df707e51e0f7ed3ca16129bc22dc03d726
|
fa1e5fac8c88c7ee3b4b6540ee3e1a2668c02557
|
/Source/abc_rand_pcg_local_avx2.c
|
d15796fd18c5d2a84b10f9528cace6b95887f6c0
|
[] |
no_license
|
zhaokg/Rbeast
|
cb6e6a2b6f846c3193c3299c72784466d331aa2b
|
2dfe69eb9d8b44512231a67aceee7f46f38d20bd
|
refs/heads/master
| 2023-09-03T10:20:22.697438
| 2023-09-01T14:38:42
| 2023-09-01T14:38:42
| 199,787,044
| 124
| 29
| null | 2022-04-07T01:11:45
| 2019-07-31T05:42:54
|
C
|
UTF-8
|
C
| false
| false
| 16,462
|
c
|
abc_rand_pcg_local_avx2.c
|
#include <stdio.h> //fprintf FILE fopen
#include <string.h>
#include <math.h>
//#include <stdlib.h> //malloc and free
#include "abc_000_warning.h"
#include "abc_datatype.h"
#include "abc_ide_util.h"
#include "abc_vec.h"
#include "abc_rand_pcg_global.h"
#include "abc_rand_pcg_local.h"
#include "assert.h"
#ifdef MSVC_COMPILER
#define __attribute__(x)
//https://stackoverflow.com/questions/21116270/gcc-attributes-with-c-methods
// In a function definition, the attribute field should go before the function name
//, but it can be put after the function decleration in the decleration
#endif
///////////////////////////////////////////////////////////////////////////
//stackoverflow.com/questions/2622017/suppressing-deprecated-warnings-in-xcode
/*
#ifdef CLANG_COMPILER
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
//do something////
#pragma clang diagnostic pop
#endif
#ifdef GCC_COMPILER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
//do something////
#pragma GCC diagnostic pop
#endif
*/
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//https://clickhouse.tech/codebrowser/html_report/ClickHouse/src/Functions/TargetSpecific.h.html
#ifdef CLANG_COMPILER
//https://stackoverflow.com/questions/31373885/how-to-change-optimization-level-of-one-function/49353441
#pragma clang optimize on
//https://stackoverflow.com/questions/46165752/does-clang-have-something-like-pragma-gcc-target
#pragma clang attribute push (__attribute__((target("sse,sse2,sse3,ssse3,sse4,popcnt,avx,fma,avx2"))), apply_to=function)
//#pragma clang attribute push (__attribute__((target("avx,avx2,avx512f,avx512dq"))), apply_to=function)
//#pragma clang attribute pop
#endif
#ifdef GCC_COMPILER
//https://www.geeksforgeeks.org/speed-up-naive-algorithms-in-competitive-coding-in-c-cpp/
//https://codeforces.com/blog/entry/78897
//https://stackoverflow.com/questions/61759552/why-some-top-level-competitive-programmers-use-pragma
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma optimization_level 3
#pragma GCC optimize("O3,Ofast,inline,omit-frame-pointer,no-asynchronous-unwind-tables") //Comment optimisations for interactive problems (use endl)
//#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,avx,avx2,fma,tune=haswell")
//#pragma GCC target("avx,avx2,avx512f,avx512dq") //https://en.wikipedia.org/wiki/AVX-512
// -mavx256-split-unaligned-load is spit out by default, hurting new CPUS
// an altertive is to set -march=hashwell, but it doesntot work in pragram for all gcc versions
// #pragma GCC optimization ("unroll-loops")
//#pragma GCC target "arch=core-avx2,tune=core-avx2"
// https://stackoverflow.com/questions/51003218/gcc-target-for-avx2-disabling-sse-instruction-set
// #pragma GCC target "arch=haswell" : // A buf for some gcc versions, not working
#endif
///////////////////////////////////////////////////////////////////////////
#if !defined(SOLARIS_COMPILER) && defined(TARGET_64) && !defined(ARM64_OS)
#include "abc_math_avx.h"
// LCG X = X * Multiplier + Shift(plus/state.inc) MOD 2^64
#define PCG_DEFAULT_MULTIPLIER_64 6364136223846793005ULL //https://github.com/imneme/pcg-c-basic/blob/master/pcg_basic.c
#define PCG_DEFAULT_INCREMENT_64 1442695040888963407ULL ////https://github.com/imneme/pcg-c/blob/master/include/pcg_variants.h
//https://github.com/imneme/pcg-c-basic/blob/master/pcg_basic.h
#define PCG_DEFAULT_GLOBAL_STATE_64 0x853c49e6748fea9bULL
#define PCG_DEFAULT_GLOBAL_INCREMENT_64 0xda3e39cb94b95bdbULL
void avx_pcg_print_state(local_pcg32_random_t* rng) {
r_printf("PCG State: \n");
r_printf("State: %" PRIx64 " %" PRIx64 " %" PRIx64 " %" PRIx64 "\n", rng->state[0], rng->state[1], rng->state[2], rng->state[3] );
r_printf("Increment: %" PRIx64 "\n", rng->increment);
r_printf("Mutiplier4: %" PRIx64 "\n", rng->MULTIPLIER_4steps);
r_printf("INcrementr4: %" PRIx64 "\n\n", rng->INCREMENT_4steps);
}
void avx_pcg_set_seed(local_pcg32_random_t *rng, U64 initstate, U64 initseq)
{
initstate = PCG_DEFAULT_GLOBAL_STATE_64 ^ initseq; //Added bcz only initseq is supplied as a seed. We run initseq to randomize initstate a little bit
initstate = initstate == 0 ? PCG_DEFAULT_GLOBAL_STATE_64 : initstate;
initseq = initseq == 0 ? PCG_DEFAULT_GLOBAL_INCREMENT_64 : initseq;
rng->increment = (initseq << 1u) | 1u; //inc must be an odd number
U64 state = 0U;
state = state * PCG_DEFAULT_MULTIPLIER_64 + rng->increment; // pcg_random(&rnd, 1);
state += initstate;
rng->state[0] = state = state * PCG_DEFAULT_MULTIPLIER_64 + rng->increment;// pcg_random(&rnd, 1);
rng->state[1] = state = state * PCG_DEFAULT_MULTIPLIER_64 + rng->increment;// pcg_random(&rnd, 1);
rng->state[2] = state = state * PCG_DEFAULT_MULTIPLIER_64 + rng->increment;// pcg_random(&rnd, 1);
rng->state[3] = state = state * PCG_DEFAULT_MULTIPLIER_64 + rng->increment;// pcg_random(&rnd, 1);
__m256i state256 = _mm256_set_epi64x(rng->state[3], rng->state[2], rng->state[1], rng->state[0]);;
//r_printf("state: %30" PRIu64 " inc: %30" PRIu64 "\n", rng->state[0], rng->increment);
// Compute the multiper and shift constants for a four-step advance
pcg_get_lcg_multiplier_shift_multistep(4L, PCG_DEFAULT_MULTIPLIER_64, rng->increment, &rng->MULTIPLIER_4steps, &rng->INCREMENT_4steps);
rng->BUF_PTR = 4;// used in the pcg_random_internalbuf (4 meaans the buf is empty: 0,1,2,3: there are still data)
extern void init_gauss_rnd(void);
init_gauss_rnd(); //Indepedent of PCG, used to initialize the GAUSS structure
}
static INLINE __m256i __attribute__((always_inline)) GetMoveMask(int n) {
__m128i maskIdx = _mm_cvtsi64_si128(0x0706050403020100);
__m256i maskNum = _mm256_cvtepu8_epi32(maskIdx);
__m256i nvec = _mm256_set1_epi32(n);
//__m256i maskmov = _mm256_sub_epi32(maskNum, nvec);
__m256i maskmov = _mm256_cmpgt_epi32(nvec, maskNum);
return maskmov;
}
#if defined(MSVC_COMPILER)
// replace hadd -> shuffle (4 uops) with shift/add/and (3 uops)
// The constant takes 2 insns to generate outside a loop.
static INLINE __m256i __attribute__((always_inline)) __mul64_haswell(__m256i a, __m256i b)
{
//https://stackoverflow.com/questions/37296289/fastest-way-to-multiply-an-array-of-int64-t
/*
// instruction does not exist. Split into 32-bit multiplies
__m256i bswap = _mm256_shuffle_epi32(b, 0xB1); // swap H<->L
__m256i prodlh = _mm256_mullo_epi32(a, bswap); // 32 bit L*H products
// or use pshufb instead of psrlq to reduce port0 pressure on Haswell
__m256i prodlh2 = _mm256_srli_epi64(prodlh, 32); // 0 , a0Hb0L, 0, a1Hb1L
__m256i prodlh3 = _mm256_add_epi32(prodlh2, prodlh); // xxx, a0Lb0H+a0Hb0L, xxx, a1Lb1H+a1Hb1L
__m256i prodlh4 = _mm256_and_si256(prodlh3, _mm256_set1_epi64x(0x00000000FFFFFFFF)); // zero high halves
__m256i prodll = _mm256_mul_epu32(a, b); // a0Lb0L,a1Lb1L, 64 bit unsigned products
__m256i prod = _mm256_add_epi64(prodll, prodlh4); // a0Lb0L+(a0Lb0H+a0Hb0L)<<32, a1Lb1L+(a1Lb1H+a1Hb1L)<<32
return prod;
*/
__m256i bswap = _mm256_shuffle_epi32(b, 0xB1); // swap H<->L
__m256i prodlh = _mm256_mullo_epi32(a, bswap); // 32 bit L*H products
__m256i zero = _mm256_setzero_si256(); // 0
__m256i prodlh2 = _mm256_hadd_epi32(prodlh, zero); // a0Lb0H+a0Hb0L,a1Lb1H+a1Hb1L,0,0
__m256i prodlh3 = _mm256_shuffle_epi32(prodlh2, 0x73); // 0, a0Lb0H+a0Hb0L, 0, a1Lb1H+a1Hb1L
__m256i prodll = _mm256_mul_epu32(a, b); // a0Lb0L,a1Lb1L, 64 bit unsigned products
__m256i prod = _mm256_add_epi64(prodll, prodlh3); // a0Lb0L+(a0Lb0H+a0Hb0L)<<32, a1Lb1L+(a1Lb1H+a1Hb1L)<<32
return prod;
}
#else
// replace hadd -> shuffle (4 uops) with shift/add/and (3 uops)
// The constant takes 2 insns to generate outside a loop.
static INLINE __m256i __mul64_haswell_ptr(__m256i * pa, __m256i *pb)
{
__m256i a = _mm256_loadu_si256(pa);
__m256i b = _mm256_loadu_si256(pb);
//https://stackoverflow.com/questions/37296289/fastest-way-to-multiply-an-array-of-int64-t
/*
// instruction does not exist. Split into 32-bit multiplies
__m256i bswap = _mm256_shuffle_epi32(b, 0xB1); // swap H<->L
__m256i prodlh = _mm256_mullo_epi32(a, bswap); // 32 bit L*H products
// or use pshufb instead of psrlq to reduce port0 pressure on Haswell
__m256i prodlh2 = _mm256_srli_epi64(prodlh, 32); // 0 , a0Hb0L, 0, a1Hb1L
__m256i prodlh3 = _mm256_add_epi32(prodlh2, prodlh); // xxx, a0Lb0H+a0Hb0L, xxx, a1Lb1H+a1Hb1L
__m256i prodlh4 = _mm256_and_si256(prodlh3, _mm256_set1_epi64x(0x00000000FFFFFFFF)); // zero high halves
__m256i prodll = _mm256_mul_epu32(a, b); // a0Lb0L,a1Lb1L, 64 bit unsigned products
__m256i prod = _mm256_add_epi64(prodll, prodlh4); // a0Lb0L+(a0Lb0H+a0Hb0L)<<32, a1Lb1L+(a1Lb1H+a1Hb1L)<<32
return prod;
*/
__m256i bswap = _mm256_shuffle_epi32(b, 0xB1); // swap H<->L
__m256i prodlh = _mm256_mullo_epi32(a, bswap); // 32 bit L*H products
__m256i zero = _mm256_setzero_si256(); // 0
__m256i prodlh2 = _mm256_hadd_epi32(prodlh, zero); // a0Lb0H+a0Hb0L,a1Lb1H+a1Hb1L,0,0
__m256i prodlh3 = _mm256_shuffle_epi32(prodlh2, 0x73); // 0, a0Lb0H+a0Hb0L, 0, a1Lb1H+a1Hb1L
__m256i prodll = _mm256_mul_epu32(a, b); // a0Lb0L,a1Lb1L, 64 bit unsigned products
__m256i prod = _mm256_add_epi64(prodll, prodlh3); // a0Lb0L+(a0Lb0H+a0Hb0L)<<32, a1Lb1L+(a1Lb1H+a1Hb1L)<<32
return prod;
}
#define __mul64_haswell(a,b) __mul64_haswell_ptr(&(a), &(b))
#endif
void avx_pcg_random(local_pcg32_random_t* rng, U32PTR rnd, I32 N) {
const __m256i INCREMENT_SHIFT = _mm256_set1_epi64x(rng->INCREMENT_4steps);
const __m256i MULITPLIER = _mm256_set1_epi64x(rng->MULTIPLIER_4steps);
#define srl _mm256_srli_epi64
#define xor _mm256_xor_si256
__m256i oldstate = _mm256_loadu_si256(rng->state);
I32 N4 = (N + 3) / 4 * 4;
for (int i = 0; i < N4; i+=4) {
__m256i xorshifted = srl ( xor(srl(oldstate, 18u), oldstate), 27u) ;
__m256i rot = srl(oldstate, 59u);
oldstate = _mm256_add_epi64(__mul64_haswell(oldstate, MULITPLIER), INCREMENT_SHIFT); //oldstate = oldstate * PCG_DEFAULT_MULTIPLIER_64 + shift;
__m256i result= _mm256_or_si256(
_mm256_srlv_epi32(xorshifted, rot),
_mm256_sllv_epi32(xorshifted, _mm256_sub_epi32(_mm256_set1_epi32(32), rot)) // //https://en.wikipedia.org/wiki/Circular_shift
); //*rnd++ = (xorshifted >> rot) | (xorshifted << ((- *((I32*)(&rot)) ) & 31)); //*rnd++ = (xorshifted >> rot) | (xorshifted << ((-rot) & 31));
__m128i r1 = _mm256_castsi256_si128(result);
__m128i r2 = _mm256_extracti128_si256(result, 1);
__m128 r = _mm_shuffle_ps(_mm_castsi128_ps(r1), _mm_castsi128_ps(r2), _MM_SHUFFLE(2, 0, 2, 0));
if (i < N - 3) {
_mm_storeu_ps(rnd + i, r);
} else {
int n = N - i;
__m256i mask = GetMoveMask(n);
_mm_maskstore_ps(rnd + i, _mm256_castsi256_si128(mask), r);
}
}
_mm256_storeu_si256(rng->state, oldstate);
_mm256_zeroupper();
}
void avx_pcg_random_with_internalbuf(local_pcg32_random_t* rng, U32PTR rnd, I32 N) {
// Move these two local variable to the rng structure so they can be initizeled during pcg_set_seed
// static __m128 INTERNAL_RNDBUF;
// static I32 BUF_PTR = 4; // 4 means theare are no data: (0,1,2,3: there are data left)
__m256i oldstate = _mm256_loadu_si256(rng->state);
// N is changing, indicating the remaining number
while (N > 0) {
if (rng->BUF_PTR < 4) {
// there is still data in the buffer; first consume the buffer
U32PTR rndbuf = (U32PTR) rng->INTERNAL_RNDBUF + rng->BUF_PTR;
if (N == 1L || rng->BUF_PTR ==3) {
rnd[0] = rndbuf[0];
++rng->BUF_PTR;
++rnd;
--N;
}
else if (rng->BUF_PTR == 0 && N >= 4) {
_mm_storeu_ps(rnd, _mm_loadu_ps(rng->INTERNAL_RNDBUF));
rng->BUF_PTR = 4L;
rnd += 4;
N -= 4;
// THen run to the bottom part to replish the buffer
} else {
// nCopy must be one of 2 and 3.
int nAvailable = (4 - rng->BUF_PTR);
int nCopy = min(nAvailable, N);
rnd[0] = rndbuf[0];
rnd[1] = rndbuf[1];
if (nCopy == 3) {
rnd[2] = rndbuf[2];
}
rng->BUF_PTR += nCopy;
rnd += nCopy;
N -= nCopy;
}
}
if (rng->BUF_PTR != 4) {
//assert(N == 0);
continue;
}
// Jump here to sample if BUF_PTR == 4
const __m256i INCREMENT_SHIFT = _mm256_set1_epi64x(rng->INCREMENT_4steps);
const __m256i MULITPLIER = _mm256_set1_epi64x(rng->MULTIPLIER_4steps);
#define srl _mm256_srli_epi64
#define xor _mm256_xor_si256
__m256i xorshifted = srl(xor (srl(oldstate, 18u), oldstate), 27u);
__m256i rot = srl(oldstate, 59u);
oldstate = _mm256_add_epi64(__mul64_haswell(oldstate, MULITPLIER), INCREMENT_SHIFT); //oldstate = oldstate * PCG_DEFAULT_MULTIPLIER_64 + shift;
__m256i result = _mm256_or_si256(
_mm256_srlv_epi32(xorshifted, rot),
_mm256_sllv_epi32(xorshifted, _mm256_sub_epi32(_mm256_set1_epi32(32), rot)) // //https://en.wikipedia.org/wiki/Circular_shift
); //*rnd++ = (xorshifted >> rot) | (xorshifted << ((- *((I32*)(&rot)) ) & 31)); //*rnd++ = (xorshifted >> rot) | (xorshifted << ((-rot) & 31));
__m128i r1 = _mm256_castsi256_si128(result);
__m128i r2 = _mm256_extracti128_si256(result, 1);
__m128 r = _mm_shuffle_ps(_mm_castsi128_ps(r1), _mm_castsi128_ps(r2), _MM_SHUFFLE(2, 0, 2, 0));
_mm_storeu_ps(rng->INTERNAL_RNDBUF, r);
rng->BUF_PTR = 0;
}
_mm256_storeu_si256(rng->state, oldstate);
_mm256_zeroupper();
}
void avx_pcg_random_vec8_slow(local_pcg32_random_t* rng,U32PTR rnd, I32 N) {
__m256i oldstate = _mm256_loadu_si256(rng->state );
const __m256i SHIFT = _mm256_set1_epi64x(rng->INCREMENT_4steps);
const __m256i MULITPLIER = _mm256_set1_epi64x(rng->MULTIPLIER_4steps);
#define srl _mm256_srli_epi64
#define xor _mm256_xor_si256
I32 N8 = (N + 7) / 8 * 8;
for (int i = 0; i < N8; i+=8) {
__m256i xorshifted = srl ( xor(srl(oldstate, 18u), oldstate), 27u) ;
__m256i rot = srl(oldstate, 59u);
oldstate = _mm256_add_epi64(__mul64_haswell(oldstate, MULITPLIER), SHIFT); //oldstate = oldstate * PCG_DEFAULT_MULTIPLIER_64 + shift;
__m256i xorshifted1 = srl(xor (srl(oldstate, 18u), oldstate), 27u);
__m256i rot1 = srl(oldstate, 59u);
xorshifted1 = _mm256_slli_epi64(xorshifted1, 32);
rot1 = _mm256_slli_epi64(rot1, 32);
//https://stackoverflow.com/questions/18298585/how-to-disable-warning-binary-constants-are-a-gcc-extension
//
xorshifted = _mm256_blend_epi32(xorshifted, xorshifted1, 0xAA); // 0b10101010);
rot = _mm256_blend_epi32(rot, rot1, 0xAA); // 0b10101010);
__m256i result= _mm256_or_si256(
_mm256_srlv_epi32(xorshifted, rot),
_mm256_sllv_epi32(xorshifted, _mm256_sub_epi32(_mm256_set1_epi32(32), rot))
); //*rnd++ = (xorshifted >> rot) | (xorshifted << ((- *((I32*)(&rot)) ) & 31)); //*rnd++ = (xorshifted >> rot) | (xorshifted << ((-rot) & 31));
oldstate = _mm256_add_epi64(__mul64_haswell(oldstate, MULITPLIER), SHIFT); //oldstate = oldstate * PCG_DEFAULT_MULTIPLIER_64 + shift;
if (i < N - 7) {
_mm256_storeu_si256(rnd + i, result);
} else {
int n = N - i;
_mm256_maskstore_epi32((I32PTR)rnd + i, GetMoveMask(n), result);
}
}
_mm256_storeu_si256(rng->state, oldstate);
}
void SetupPCG_AVX2(void){
local_pcg_set_seed = avx_pcg_set_seed;
//local_pcg_random = avx_pcg_random;
local_pcg_random=avx_pcg_random_with_internalbuf;
local_pcg_print_state = avx_pcg_print_state;
}
#endif
///////////////////////////////////////////////////////////////////////////
#ifdef CLANG_COMPILER
//pragma clang attribute push (__attribute__((target("avx,avx2"))), apply_to=function)
#pragma clang attribute pop
#endif
///////////////////////////////////////////////////////////////////////////
#include "abc_000_warning.h"
|
26008be3f7b219643167d79c8beeec1d4738a544
|
549270020f6c8724e2ef1b12e38d11b025579f8d
|
/recipes/detools/all/test_package/test_package.c
|
e96fd3f5f3d9ac58108be44e1ecb063ae9e98d32
|
[
"MIT"
] |
permissive
|
conan-io/conan-center-index
|
1bcec065ccd65aa38b1fed93fbd94d9d5fe6bc43
|
3b17e69bb4e5601a850b6e006e44775e690bac33
|
refs/heads/master
| 2023-08-31T11:34:45.403978
| 2023-08-31T11:13:23
| 2023-08-31T11:13:23
| 204,671,232
| 844
| 1,820
|
MIT
| 2023-09-14T21:22:42
| 2019-08-27T09:43:58
|
Python
|
UTF-8
|
C
| false
| false
| 437
|
c
|
test_package.c
|
#include <stdlib.h>
#include "detools.h"
#define EXPECTED_PATCHED_FILE_SIZE 2780
int main(int argc, const char *argv[])
{
int res;
if (argc != 4) {
printf("Wrong number of arguments.\n");
return EXIT_FAILURE;
}
res = detools_apply_patch_filenames(argv[1], argv[2], argv[3]);
if (res == EXPECTED_PATCHED_FILE_SIZE) {
return EXIT_SUCCESS;
} else {
return EXIT_FAILURE;
}
}
|
5554699c12ffe0fdefa129be3d8b962105968706
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/arch/arm/src/kinetis/kinetis_lpuart.h
|
6a24ca3138a947cb81d328a5f7a4c8d0a4ac13d7
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 3,896
|
h
|
kinetis_lpuart.h
|
/****************************************************************************
* arch/arm/src/kinetis/kinetis_lpuart.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/
#ifndef __ARCH_ARM_SRC_KINETIS_KINETIS_LPUART_H
#define __ARCH_ARM_SRC_KINETIS_KINETIS_LPUART_H
#if defined(HAVE_UART_DEVICE) && defined(USE_SERIALDRIVER)
/****************************************************************************
* Included Files
****************************************************************************/
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Is DMA available on any (enabled) LPUART? */
#undef LPSERIAL_HAVE_DMA
#if defined(CONFIG_KINETIS_LPUART0_RXDMA) || defined(CONFIG_KINETIS_LPUART1_RXDMA) || \
defined(CONFIG_KINETIS_LPUART2_RXDMA) || defined(CONFIG_KINETIS_LPUART3_RXDMA) || \
defined(CONFIG_KINETIS_LPUART4_RXDMA)
# define LPSERIAL_HAVE_DMA 1
/* Is DMA available on All (enabled) LPUART? */
#define LPSERIAL_HAVE_ALL_DMA 1
# if (defined(CONFIG_KINETIS_LPUART0) && !defined(CONFIG_KINETIS_LPUART0_RXDMA)) || \
(defined(CONFIG_KINETIS_LPUART1) && !defined(CONFIG_KINETIS_LPUART1_RXDMA)) || \
(defined(CONFIG_KINETIS_LPUART2) && !defined(CONFIG_KINETIS_LPUART2_RXDMA)) || \
(defined(CONFIG_KINETIS_LPUART3) && !defined(CONFIG_KINETIS_LPUART3_RXDMA)) || \
(defined(CONFIG_KINETIS_LPUART4) && !defined(CONFIG_KINETIS_LPUART4_RXDMA))
# undef LPSERIAL_HAVE_ALL_DMA
# endif
#endif
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
/****************************************************************************
* Name: kinetis_serial_dma_poll
*
* Description:
* Must be called periodically if any Kinetis LPUART is configured for DMA.
* The DMA callback is triggered for each fifo size/2 bytes, but this can
* result in some bytes being transferred but not collected if the incoming
* data is not a whole multiple of half the FIFO size.
*
* May be safely called from either interrupt or thread context.
*
****************************************************************************/
#ifdef LPSERIAL_HAVE_DMA
void kinetis_lpserial_dma_poll(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* HAVE_UART_DEVICE && USE_SERIALDRIVER) */
#endif /* __ARCH_ARM_SRC_KINETIS_KINETIS_UART_H */
|
11fe682665e9cf35b374802c00cae89bb2ec7270
|
33377c4d113cf9ea1338077af6bd645f3c5796b3
|
/extensions/tutorial/helloworld2/mylib.c
|
77e344a2a5af3df4aedbbe7849d705bdb51523db
|
[
"LicenseRef-scancode-free-unknown",
"MIT"
] |
permissive
|
ring-lang/ring
|
56f55111f751b0274d4f588871f806a8c2734dea
|
2081d2efb41c9dacd49b7a6944b9ca332638ba64
|
refs/heads/master
| 2023-09-04T16:54:44.309452
| 2023-09-03T10:28:57
| 2023-09-03T10:28:57
| 54,633,811
| 1,360
| 555
|
MIT
| 2023-08-03T01:48:24
| 2016-03-24T10:29:27
|
C
|
UTF-8
|
C
| false
| false
| 165
|
c
|
mylib.c
|
#include "ring.h"
#include "stdlib.h"
RING_FUNC(ring_myfunction)
{
printf("Hello, World!");
}
RING_LIBINIT
{
RING_API_REGISTER("myfunction",ring_myfunction);
}
|
6752e95b38e6bdcf8ca6f0acd452f3ce576b6c10
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/at32/libraries/rt_drivers/drv_usbd.h
|
37d9c5d952adcaf95bd303a702f1bd835210be98
|
[
"Apache-2.0",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 555
|
h
|
drv_usbd.h
|
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2023-02-28 shelton first version
*/
#ifndef __DRV_USBD_H__
#define __DRV_USBD_H__
#include <rtthread.h>
#include <rtdevice.h>
#include "drv_common.h"
#if defined(BSP_USING_USBD)
#include "usbd_core.h"
struct at32_usbd {
char *name;
usbd_core_type *p_usbd_core;
IRQn_Type irqn;
};
#endif
#endif /* __DRV_USBD_H__ */
/******************* end of file *******************/
|
4569ded752051cc82d940e01a0fa1bb089756657
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/at32/libraries/AT32F421_Firmware_Library/drivers/inc/at32f421_adc.h
|
c0585c0500b9b0b92b2b1b4b08330b496948c00e
|
[
"Apache-2.0",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 20,482
|
h
|
at32f421_adc.h
|
/**
**************************************************************************
* @file at32f421_adc.h
* @brief at32f421 adc header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
* GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
* TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
* STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
* INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
*
**************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __AT32F421_ADC_H
#define __AT32F421_ADC_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "at32f421.h"
/** @addtogroup AT32F421_periph_driver
* @{
*/
/** @addtogroup ADC
* @{
*/
/** @defgroup ADC_interrupts_definition
* @brief adc interrupt
* @{
*/
#define ADC_CCE_INT ((uint32_t)0x00000020) /*!< channels conversion end interrupt */
#define ADC_VMOR_INT ((uint32_t)0x00000040) /*!< voltage monitoring out of range interrupt */
#define ADC_PCCE_INT ((uint32_t)0x00000080) /*!< preempt channels conversion end interrupt */
/**
* @}
*/
/** @defgroup ADC_flags_definition
* @brief adc flag
* @{
*/
#define ADC_VMOR_FLAG ((uint8_t)0x01) /*!< voltage monitoring out of range flag */
#define ADC_CCE_FLAG ((uint8_t)0x02) /*!< channels conversion end flag */
#define ADC_PCCE_FLAG ((uint8_t)0x04) /*!< preempt channels conversion end flag */
#define ADC_PCCS_FLAG ((uint8_t)0x08) /*!< preempt channel conversion start flag */
#define ADC_OCCS_FLAG ((uint8_t)0x10) /*!< ordinary channel conversion start flag */
/**
* @}
*/
/** @defgroup ADC_exported_types
* @{
*/
/**
* @brief adc data align type
*/
typedef enum
{
ADC_RIGHT_ALIGNMENT = 0x00, /*!< data right alignment */
ADC_LEFT_ALIGNMENT = 0x01 /*!< data left alignment */
} adc_data_align_type;
/**
* @brief adc channel select type
*/
typedef enum
{
ADC_CHANNEL_0 = 0x00, /*!< adc channel 0 */
ADC_CHANNEL_1 = 0x01, /*!< adc channel 1 */
ADC_CHANNEL_2 = 0x02, /*!< adc channel 2 */
ADC_CHANNEL_3 = 0x03, /*!< adc channel 3 */
ADC_CHANNEL_4 = 0x04, /*!< adc channel 4 */
ADC_CHANNEL_5 = 0x05, /*!< adc channel 5 */
ADC_CHANNEL_6 = 0x06, /*!< adc channel 6 */
ADC_CHANNEL_7 = 0x07, /*!< adc channel 7 */
ADC_CHANNEL_8 = 0x08, /*!< adc channel 8 */
ADC_CHANNEL_9 = 0x09, /*!< adc channel 9 */
ADC_CHANNEL_10 = 0x0A, /*!< adc channel 10 */
ADC_CHANNEL_11 = 0x0B, /*!< adc channel 11 */
ADC_CHANNEL_12 = 0x0C, /*!< adc channel 12 */
ADC_CHANNEL_13 = 0x0D, /*!< adc channel 13 */
ADC_CHANNEL_14 = 0x0E, /*!< adc channel 14 */
ADC_CHANNEL_15 = 0x0F, /*!< adc channel 15 */
ADC_CHANNEL_16 = 0x10, /*!< adc channel 16 */
ADC_CHANNEL_17 = 0x11 /*!< adc channel 17 */
} adc_channel_select_type;
/**
* @brief adc sampletime select type
*/
typedef enum
{
ADC_SAMPLETIME_1_5 = 0x00, /*!< adc sample time 1.5 cycle */
ADC_SAMPLETIME_7_5 = 0x01, /*!< adc sample time 7.5 cycle */
ADC_SAMPLETIME_13_5 = 0x02, /*!< adc sample time 13.5 cycle */
ADC_SAMPLETIME_28_5 = 0x03, /*!< adc sample time 28.5 cycle */
ADC_SAMPLETIME_41_5 = 0x04, /*!< adc sample time 41.5 cycle */
ADC_SAMPLETIME_55_5 = 0x05, /*!< adc sample time 55.5 cycle */
ADC_SAMPLETIME_71_5 = 0x06, /*!< adc sample time 71.5 cycle */
ADC_SAMPLETIME_239_5 = 0x07 /*!< adc sample time 239.5 cycle */
} adc_sampletime_select_type;
/**
* @brief adc ordinary group trigger event select type
*/
typedef enum
{
/*adc1 ordinary trigger event*/
ADC12_ORDINARY_TRIG_TMR1CH1 = 0x00, /*!< timer1 ch1 event as trigger source of adc1 ordinary sequence */
ADC12_ORDINARY_TRIG_TMR1CH2 = 0x01, /*!< timer1 ch2 event as trigger source of adc1 ordinary sequence */
ADC12_ORDINARY_TRIG_TMR1CH3 = 0x02, /*!< timer1 ch3 event as trigger source of adc1 ordinary sequence */
ADC12_ORDINARY_TRIG_TMR3TRGOUT = 0x04, /*!< timer3 trgout event as trigger source of adc1 ordinary sequence */
ADC12_ORDINARY_TRIG_TMR15CH1 = 0x05, /*!< timer15 ch1 event as trigger source of adc1 ordinary sequence */
ADC12_ORDINARY_TRIG_EXINT11 = 0x06, /*!< exint line11 event as trigger source of adc1 ordinary sequence */
ADC12_ORDINARY_TRIG_SOFTWARE = 0x07, /*!< software(OCSWTRG) control bit as trigger source of adc1 ordinary sequence */
} adc_ordinary_trig_select_type;
/**
* @brief adc preempt group trigger event select type
*/
typedef enum
{
/*adc1 preempt trigger event*/
ADC12_PREEMPT_TRIG_TMR1TRGOUT = 0x00, /*!< timer1 trgout event as trigger source of adc1 preempt sequence */
ADC12_PREEMPT_TRIG_TMR1CH4 = 0x01, /*!< timer1 ch4 event as trigger source of adc1 preempt sequence */
ADC12_PREEMPT_TRIG_TMR3CH4 = 0x04, /*!< timer3 ch4 event as trigger source of adc1 preempt sequence */
ADC12_PREEMPT_TRIG_TMR15TRGOUT = 0x05, /*!< timer15 trgout event as trigger source of adc1 preempt sequence */
ADC12_PREEMPT_TRIG_EXINT15 = 0x06, /*!< exint line15 event as trigger source of adc1 preempt sequence */
ADC12_PREEMPT_TRIG_SOFTWARE = 0x07, /*!< software(PCSWTRG) control bit as trigger source of adc1 preempt sequence */
} adc_preempt_trig_select_type;
/**
* @brief adc preempt channel type
*/
typedef enum
{
ADC_PREEMPT_CHANNEL_1 = 0x00, /*!< adc preempt channel 1 */
ADC_PREEMPT_CHANNEL_2 = 0x01, /*!< adc preempt channel 2 */
ADC_PREEMPT_CHANNEL_3 = 0x02, /*!< adc preempt channel 3 */
ADC_PREEMPT_CHANNEL_4 = 0x03 /*!< adc preempt channel 4 */
} adc_preempt_channel_type;
/**
* @brief adc voltage_monitoring type
*/
typedef enum
{
ADC_VMONITOR_SINGLE_ORDINARY = 0x00800200, /*!< voltage_monitoring on a single ordinary channel */
ADC_VMONITOR_SINGLE_PREEMPT = 0x00400200, /*!< voltage_monitoring on a single preempt channel */
ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT = 0x00C00200, /*!< voltage_monitoring on a single ordinary or preempt channel */
ADC_VMONITOR_ALL_ORDINARY = 0x00800000, /*!< voltage_monitoring on all ordinary channel */
ADC_VMONITOR_ALL_PREEMPT = 0x00400000, /*!< voltage_monitoring on all preempt channel */
ADC_VMONITOR_ALL_ORDINARY_PREEMPT = 0x00C00000, /*!< voltage_monitoring on all ordinary and preempt channel */
ADC_VMONITOR_NONE = 0x00000000 /*!< no channel guarded by the voltage_monitoring */
} adc_voltage_monitoring_type;
/**
* @brief adc base config type
*/
typedef struct
{
confirm_state sequence_mode; /*!< adc sequence mode */
confirm_state repeat_mode; /*!< adc repeat mode */
adc_data_align_type data_align; /*!< adc data alignment */
uint8_t ordinary_channel_length; /*!< adc ordinary channel sequence length*/
} adc_base_config_type;
/**
* @brief type define adc register all
*/
typedef struct
{
/**
* @brief adc sts register, offset:0x00
*/
union
{
__IO uint32_t sts;
struct
{
__IO uint32_t vmor : 1; /* [0] */
__IO uint32_t cce : 1; /* [1] */
__IO uint32_t pcce : 1; /* [2] */
__IO uint32_t pccs : 1; /* [3] */
__IO uint32_t occs : 1; /* [4] */
__IO uint32_t reserved1 : 27;/* [31:5] */
} sts_bit;
};
/**
* @brief adc ctrl1 register, offset:0x04
*/
union
{
__IO uint32_t ctrl1;
struct
{
__IO uint32_t vmcsel : 5; /* [4:0] */
__IO uint32_t cceien : 1; /* [5] */
__IO uint32_t vmorien : 1; /* [6] */
__IO uint32_t pcceien : 1; /* [7] */
__IO uint32_t sqen : 1; /* [8] */
__IO uint32_t vmsgen : 1; /* [9] */
__IO uint32_t pcautoen : 1; /* [10] */
__IO uint32_t ocpen : 1; /* [11] */
__IO uint32_t pcpen : 1; /* [12] */
__IO uint32_t ocpcnt : 3; /* [15:13] */
__IO uint32_t reserved1 : 6; /* [21:16] */
__IO uint32_t pcvmen : 1; /* [22] */
__IO uint32_t ocvmen : 1; /* [23] */
__IO uint32_t reserved2 : 8; /* [31:24] */
} ctrl1_bit;
};
/**
* @brief adc ctrl2 register, offset:0x08
*/
union
{
__IO uint32_t ctrl2;
struct
{
__IO uint32_t adcen : 1; /* [0] */
__IO uint32_t rpen : 1; /* [1] */
__IO uint32_t adcal : 1; /* [2] */
__IO uint32_t adcalinit : 1; /* [3] */
__IO uint32_t reserved1 : 4; /* [7:4] */
__IO uint32_t ocdmaen : 1; /* [8] */
__IO uint32_t reserved2 : 2; /* [10:9] */
__IO uint32_t dtalign : 1; /* [11] */
__IO uint32_t pctesel_l : 3; /* [14:12] */
__IO uint32_t pcten : 1; /* [15] */
__IO uint32_t reserved3 : 1; /* [16] */
__IO uint32_t octesel_l : 3; /* [19:17] */
__IO uint32_t octen : 1; /* [20] */
__IO uint32_t pcswtrg : 1; /* [21] */
__IO uint32_t ocswtrg : 1; /* [22] */
__IO uint32_t itsrven : 1; /* [23] */
__IO uint32_t pctesel_h : 1; /* [24] */
__IO uint32_t octesel_h : 1; /* [25] */
__IO uint32_t reserved4 : 6; /* [31:26] */
} ctrl2_bit;
};
/**
* @brief adc spt1 register, offset:0x0C
*/
union
{
__IO uint32_t spt1;
struct
{
__IO uint32_t cspt10 : 3; /* [2:0] */
__IO uint32_t cspt11 : 3; /* [5:3] */
__IO uint32_t cspt12 : 3; /* [8:6] */
__IO uint32_t cspt13 : 3; /* [11:9] */
__IO uint32_t cspt14 : 3; /* [14:12] */
__IO uint32_t cspt15 : 3; /* [17:15] */
__IO uint32_t cspt16 : 3; /* [20:18] */
__IO uint32_t cspt17 : 3; /* [23:21] */
__IO uint32_t reserved1 : 8;/* [31:24] */
} spt1_bit;
};
/**
* @brief adc spt2 register, offset:0x10
*/
union
{
__IO uint32_t spt2;
struct
{
__IO uint32_t cspt0 : 3;/* [2:0] */
__IO uint32_t cspt1 : 3;/* [5:3] */
__IO uint32_t cspt2 : 3;/* [8:6] */
__IO uint32_t cspt3 : 3;/* [11:9] */
__IO uint32_t cspt4 : 3;/* [14:12] */
__IO uint32_t cspt5 : 3;/* [17:15] */
__IO uint32_t cspt6 : 3;/* [20:18] */
__IO uint32_t cspt7 : 3;/* [23:21] */
__IO uint32_t cspt8 : 3;/* [26:24] */
__IO uint32_t cspt9 : 3;/* [29:27] */
__IO uint32_t reserved1 : 2;/* [31:30] */
} spt2_bit;
};
/**
* @brief adc pcdto1 register, offset:0x14
*/
union
{
__IO uint32_t pcdto1;
struct
{
__IO uint32_t pcdto1 : 12; /* [11:0] */
__IO uint32_t reserved1 : 20; /* [31:12] */
} pcdto1_bit;
};
/**
* @brief adc pcdto2 register, offset:0x18
*/
union
{
__IO uint32_t pcdto2;
struct
{
__IO uint32_t pcdto2 : 12; /* [11:0] */
__IO uint32_t reserved1 : 20; /* [31:12] */
} pcdto2_bit;
};
/**
* @brief adc pcdto3 register, offset:0x1C
*/
union
{
__IO uint32_t pcdto3;
struct
{
__IO uint32_t pcdto3 : 12; /* [11:0] */
__IO uint32_t reserved1 : 20; /* [31:12] */
} pcdto3_bit;
};
/**
* @brief adc pcdto4 register, offset:0x20
*/
union
{
__IO uint32_t pcdto4;
struct
{
__IO uint32_t pcdto4 : 12; /* [11:0] */
__IO uint32_t reserved1 : 20; /* [31:12] */
} pcdto4_bit;
};
/**
* @brief adc vmhb register, offset:0x24
*/
union
{
__IO uint32_t vmhb;
struct
{
__IO uint32_t vmhb : 12; /* [11:0] */
__IO uint32_t reserved1 : 20; /* [31:12] */
} vmhb_bit;
};
/**
* @brief adc vmlb register, offset:0x28
*/
union
{
__IO uint32_t vmlb;
struct
{
__IO uint32_t vmlb : 12; /* [11:0] */
__IO uint32_t reserved1 : 20; /* [31:12] */
} vmlb_bit;
};
/**
* @brief adc osq1 register, offset:0x2C
*/
union
{
__IO uint32_t osq1;
struct
{
__IO uint32_t osn13 : 5; /* [4:0] */
__IO uint32_t osn14 : 5; /* [9:5] */
__IO uint32_t osn15 : 5; /* [14:10] */
__IO uint32_t osn16 : 5; /* [19:15] */
__IO uint32_t oclen : 4; /* [23:20] */
__IO uint32_t reserved1 : 8; /* [31:24] */
} osq1_bit;
};
/**
* @brief adc osq2 register, offset:0x30
*/
union
{
__IO uint32_t osq2;
struct
{
__IO uint32_t osn7 : 5; /* [4:0] */
__IO uint32_t osn8 : 5; /* [9:5] */
__IO uint32_t osn9 : 5; /* [14:10] */
__IO uint32_t osn10 : 5; /* [19:15] */
__IO uint32_t osn11 : 5; /* [24:20] */
__IO uint32_t osn12 : 5; /* [29:25] */
__IO uint32_t reserved1 : 2; /* [31:30] */
} osq2_bit;
};
/**
* @brief adc osq3 register, offset:0x34
*/
union
{
__IO uint32_t osq3;
struct
{
__IO uint32_t osn1 : 5; /* [4:0] */
__IO uint32_t osn2 : 5; /* [9:5] */
__IO uint32_t osn3 : 5; /* [14:10] */
__IO uint32_t osn4 : 5; /* [19:15] */
__IO uint32_t osn5 : 5; /* [24:20] */
__IO uint32_t osn6 : 5; /* [29:25] */
__IO uint32_t reserved1 : 2; /* [31:30] */
} osq3_bit;
};
/**
* @brief adc psq register, offset:0x38
*/
union
{
__IO uint32_t psq;
struct
{
__IO uint32_t psn1 : 5; /* [4:0] */
__IO uint32_t psn2 : 5; /* [9:5] */
__IO uint32_t psn3 : 5; /* [14:10] */
__IO uint32_t psn4 : 5; /* [19:15] */
__IO uint32_t pclen : 2; /* [21:20] */
__IO uint32_t reserved1 : 10;/* [31:22] */
} psq_bit;
};
/**
* @brief adc pdt1 register, offset:0x3C
*/
union
{
__IO uint32_t pdt1;
struct
{
__IO uint32_t pdt1 : 16; /* [15:0] */
__IO uint32_t reserved1 : 16; /* [31:16] */
} pdt1_bit;
};
/**
* @brief adc pdt2 register, offset:0x40
*/
union
{
__IO uint32_t pdt2;
struct
{
__IO uint32_t pdt2 : 16; /* [15:0] */
__IO uint32_t reserved1 : 16; /* [31:16] */
} pdt2_bit;
};
/**
* @brief adc pdt3 register, offset:0x44
*/
union
{
__IO uint32_t pdt3;
struct
{
__IO uint32_t pdt3 : 16; /* [15:0] */
__IO uint32_t reserved1 : 16; /* [31:16] */
} pdt3_bit;
};
/**
* @brief adc pdt4 register, offset:0x48
*/
union
{
__IO uint32_t pdt4;
struct
{
__IO uint32_t pdt4 : 16; /* [15:0] */
__IO uint32_t reserved1 : 16; /* [31:16] */
} pdt4_bit;
};
/**
* @brief adc odt register, offset:0x4C
*/
union
{
__IO uint32_t odt;
struct
{
__IO uint32_t odt : 16; /* [15:0] */
__IO uint32_t reserved1 : 16; /* [31:16] */
} odt_bit;
};
} adc_type;
/**
* @}
*/
#define ADC1 ((adc_type *) ADC1_BASE)
/** @defgroup ADC_exported_functions
* @{
*/
void adc_reset(adc_type *adc_x);
void adc_enable(adc_type *adc_x, confirm_state new_state);
void adc_base_default_para_init(adc_base_config_type *adc_base_struct);
void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct);
void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state);
void adc_interrupt_enable(adc_type *adc_x, uint32_t adc_int, confirm_state new_state);
void adc_calibration_init(adc_type *adc_x);
flag_status adc_calibration_init_status_get(adc_type *adc_x);
void adc_calibration_start(adc_type *adc_x);
flag_status adc_calibration_status_get(adc_type *adc_x);
void adc_voltage_monitor_enable(adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring);
void adc_voltage_monitor_threshold_value_set(adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold);
void adc_voltage_monitor_single_channel_select(adc_type *adc_x, adc_channel_select_type adc_channel);
void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime);
void adc_preempt_channel_length_set(adc_type *adc_x, uint8_t adc_channel_lenght);
void adc_preempt_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime);
void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state);
void adc_preempt_conversion_trigger_set(adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state);
void adc_preempt_offset_value_set(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value);
void adc_ordinary_part_count_set(adc_type *adc_x, uint8_t adc_channel_count);
void adc_ordinary_part_mode_enable(adc_type *adc_x, confirm_state new_state);
void adc_preempt_part_mode_enable(adc_type *adc_x, confirm_state new_state);
void adc_preempt_auto_mode_enable(adc_type *adc_x, confirm_state new_state);
void adc_tempersensor_vintrv_enable(confirm_state new_state);
void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state);
flag_status adc_ordinary_software_trigger_status_get(adc_type *adc_x);
void adc_preempt_software_trigger_enable(adc_type *adc_x, confirm_state new_state);
flag_status adc_preempt_software_trigger_status_get(adc_type *adc_x);
uint16_t adc_ordinary_conversion_data_get(adc_type *adc_x);
uint16_t adc_preempt_conversion_data_get(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel);
flag_status adc_flag_get(adc_type *adc_x, uint8_t adc_flag);
void adc_flag_clear(adc_type *adc_x, uint32_t adc_flag);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif
|
07c053aac75e1cbb3866cb6a5be4f1b569599686
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/tests/usr.bin/xlint/lint1/msg_164.c
|
5eb121fa82347ebbe2f7892655b517f736272b02
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 600
|
c
|
msg_164.c
|
/* $NetBSD: msg_164.c,v 1.6 2023/07/07 19:45:22 rillig Exp $ */
# 3 "msg_164.c"
// Test for message: assignment of negative constant to unsigned type [164]
/* lint1-extra-flags: -X 351 */
void
example(void)
{
/* expect+1: warning: initialization of unsigned with negative constant [221] */
unsigned char uch = -3;
/* expect+1: warning: assignment of negative constant to unsigned type [164] */
uch = -5;
/* expect+1: warning: conversion of negative constant to unsigned type [222] */
uch += -7;
/* expect+1: warning: conversion of negative constant to unsigned type [222] */
uch *= -1;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.