├── .gitignore ├── 915resolution ├── 915resolution.c ├── LICENCE └── Makefile.core.def ├── README.md ├── android ├── Makefile.core.def └── android.c ├── apple_gmux ├── Makefile.core.def └── apple_gmux.c ├── bits-deps ├── acpica │ └── source │ │ ├── common │ │ ├── acgetline.c │ │ ├── adfile.c │ │ ├── adisasm.c │ │ ├── adwalk.c │ │ ├── ahids.c │ │ ├── ahpredef.c │ │ ├── ahtable.c │ │ ├── ahuuids.c │ │ ├── cmfsize.c │ │ ├── dmextern.c │ │ ├── dmrestag.c │ │ ├── dmtable.c │ │ ├── dmtbdump.c │ │ ├── dmtbinfo.c │ │ └── getopt.c │ │ ├── components │ │ ├── disassembler │ │ │ ├── dmbuffer.c │ │ │ ├── dmcstyle.c │ │ │ ├── dmdeferred.c │ │ │ ├── dmnames.c │ │ │ ├── dmopcode.c │ │ │ ├── dmresrc.c │ │ │ ├── dmresrcl.c │ │ │ ├── dmresrcl2.c │ │ │ ├── dmresrcs.c │ │ │ ├── dmutils.c │ │ │ └── dmwalk.c │ │ ├── dispatcher │ │ │ ├── dsargs.c │ │ │ ├── dscontrol.c │ │ │ ├── dsdebug.c │ │ │ ├── dsfield.c │ │ │ ├── dsinit.c │ │ │ ├── dsmethod.c │ │ │ ├── dsmthdat.c │ │ │ ├── dsobject.c │ │ │ ├── dsopcode.c │ │ │ ├── dsutils.c │ │ │ ├── dswexec.c │ │ │ ├── dswload.c │ │ │ ├── dswload2.c │ │ │ ├── dswscope.c │ │ │ └── dswstate.c │ │ ├── events │ │ │ ├── evevent.c │ │ │ ├── evglock.c │ │ │ ├── evgpe.c │ │ │ ├── evgpeblk.c │ │ │ ├── evgpeinit.c │ │ │ ├── evgpeutil.c │ │ │ ├── evhandler.c │ │ │ ├── evmisc.c │ │ │ ├── evregion.c │ │ │ ├── evrgnini.c │ │ │ ├── evsci.c │ │ │ ├── evxface.c │ │ │ ├── evxfevnt.c │ │ │ ├── evxfgpe.c │ │ │ └── evxfregn.c │ │ ├── executer │ │ │ ├── exconfig.c │ │ │ ├── exconvrt.c │ │ │ ├── excreate.c │ │ │ ├── exdebug.c │ │ │ ├── exdump.c │ │ │ ├── exfield.c │ │ │ ├── exfldio.c │ │ │ ├── exmisc.c │ │ │ ├── exmutex.c │ │ │ ├── exnames.c │ │ │ ├── exoparg1.c │ │ │ ├── exoparg2.c │ │ │ ├── exoparg3.c │ │ │ ├── exoparg6.c │ │ │ ├── exprep.c │ │ │ ├── exregion.c │ │ │ ├── exresnte.c │ │ │ ├── exresolv.c │ │ │ ├── exresop.c │ │ │ ├── exstore.c │ │ │ ├── exstoren.c │ │ │ ├── exstorob.c │ │ │ ├── exsystem.c │ │ │ └── exutils.c │ │ ├── hardware │ │ │ ├── hwacpi.c │ │ │ ├── hwesleep.c │ │ │ ├── hwgpe.c │ │ │ ├── hwpci.c │ │ │ ├── hwregs.c │ │ │ ├── hwsleep.c │ │ │ ├── hwtimer.c │ │ │ ├── hwvalid.c │ │ │ ├── hwxface.c │ │ │ └── hwxfsleep.c │ │ ├── namespace │ │ │ ├── nsaccess.c │ │ │ ├── nsalloc.c │ │ │ ├── nsarguments.c │ │ │ ├── nsconvert.c │ │ │ ├── nsdump.c │ │ │ ├── nsdumpdv.c │ │ │ ├── nseval.c │ │ │ ├── nsinit.c │ │ │ ├── nsload.c │ │ │ ├── nsnames.c │ │ │ ├── nsobject.c │ │ │ ├── nsparse.c │ │ │ ├── nspredef.c │ │ │ ├── nsprepkg.c │ │ │ ├── nsrepair.c │ │ │ ├── nsrepair2.c │ │ │ ├── nssearch.c │ │ │ ├── nsutils.c │ │ │ ├── nswalk.c │ │ │ ├── nsxfeval.c │ │ │ ├── nsxfname.c │ │ │ └── nsxfobj.c │ │ ├── parser │ │ │ ├── psargs.c │ │ │ ├── psloop.c │ │ │ ├── psobject.c │ │ │ ├── psopcode.c │ │ │ ├── psopinfo.c │ │ │ ├── psparse.c │ │ │ ├── psscope.c │ │ │ ├── pstree.c │ │ │ ├── psutils.c │ │ │ ├── pswalk.c │ │ │ └── psxface.c │ │ ├── resources │ │ │ ├── rsaddr.c │ │ │ ├── rscalc.c │ │ │ ├── rscreate.c │ │ │ ├── rsdump.c │ │ │ ├── rsdumpinfo.c │ │ │ ├── rsinfo.c │ │ │ ├── rsio.c │ │ │ ├── rsirq.c │ │ │ ├── rslist.c │ │ │ ├── rsmemory.c │ │ │ ├── rsmisc.c │ │ │ ├── rsserial.c │ │ │ ├── rsutils.c │ │ │ └── rsxface.c │ │ ├── tables │ │ │ ├── tbdata.c │ │ │ ├── tbfadt.c │ │ │ ├── tbfind.c │ │ │ ├── tbinstal.c │ │ │ ├── tbprint.c │ │ │ ├── tbutils.c │ │ │ ├── tbxface.c │ │ │ ├── tbxfload.c │ │ │ └── tbxfroot.c │ │ └── utilities │ │ │ ├── utaddress.c │ │ │ ├── utalloc.c │ │ │ ├── utbuffer.c │ │ │ ├── utcache.c │ │ │ ├── utclib.c │ │ │ ├── utcopy.c │ │ │ ├── utdebug.c │ │ │ ├── utdecode.c │ │ │ ├── utdelete.c │ │ │ ├── uterror.c │ │ │ ├── uteval.c │ │ │ ├── utexcep.c │ │ │ ├── utfileio.c │ │ │ ├── utglobal.c │ │ │ ├── uthex.c │ │ │ ├── utids.c │ │ │ ├── utinit.c │ │ │ ├── utlock.c │ │ │ ├── utmath.c │ │ │ ├── utmisc.c │ │ │ ├── utmutex.c │ │ │ ├── utnonansi.c │ │ │ ├── utobject.c │ │ │ ├── utosi.c │ │ │ ├── utownerid.c │ │ │ ├── utpredef.c │ │ │ ├── utprint.c │ │ │ ├── utresrc.c │ │ │ ├── utstate.c │ │ │ ├── utstring.c │ │ │ ├── uttrack.c │ │ │ ├── utuuid.c │ │ │ ├── utxface.c │ │ │ ├── utxferror.c │ │ │ ├── utxfinit.c │ │ │ └── utxfmutex.c │ │ └── include │ │ ├── acapps.h │ │ ├── acbuffer.h │ │ ├── acclib.h │ │ ├── accommon.h │ │ ├── acconfig.h │ │ ├── acdebug.h │ │ ├── acdisasm.h │ │ ├── acdispat.h │ │ ├── acevents.h │ │ ├── acexcep.h │ │ ├── acglobal.h │ │ ├── achware.h │ │ ├── acinterp.h │ │ ├── aclocal.h │ │ ├── acmacros.h │ │ ├── acnames.h │ │ ├── acnamesp.h │ │ ├── acobject.h │ │ ├── acopcode.h │ │ ├── acoutput.h │ │ ├── acparser.h │ │ ├── acpi.h │ │ ├── acpiosxf.h │ │ ├── acpixf.h │ │ ├── acpredef.h │ │ ├── acresrc.h │ │ ├── acrestyp.h │ │ ├── acstruct.h │ │ ├── actables.h │ │ ├── actbl.h │ │ ├── actbl1.h │ │ ├── actbl2.h │ │ ├── actbl3.h │ │ ├── actypes.h │ │ ├── acutils.h │ │ ├── acuuid.h │ │ ├── amlcode.h │ │ ├── amlresrc.h │ │ └── platform │ │ ├── accygwin.h │ │ ├── acdragonfly.h │ │ ├── acdragonflyex.h │ │ ├── acefi.h │ │ ├── acefiex.h │ │ ├── acenv.h │ │ ├── acenvex.h │ │ ├── acfreebsd.h │ │ ├── acgcc.h │ │ ├── achaiku.h │ │ ├── acintel.h │ │ ├── aclinux.h │ │ ├── aclinuxex.h │ │ ├── acmacosx.h │ │ ├── acmsvc.h │ │ ├── acmsvcex.h │ │ ├── acnetbsd.h │ │ ├── acos2.h │ │ ├── acwin.h │ │ ├── acwin64.h │ │ └── acwinex.h └── python │ ├── .gitattributes │ ├── .gitignore │ ├── Include │ ├── Python-ast.h │ ├── Python.h │ ├── abstract.h │ ├── asdl.h │ ├── ast.h │ ├── bitset.h │ ├── boolobject.h │ ├── bufferobject.h │ ├── bytearrayobject.h │ ├── bytes_methods.h │ ├── bytesobject.h │ ├── cStringIO.h │ ├── cellobject.h │ ├── ceval.h │ ├── classobject.h │ ├── cobject.h │ ├── code.h │ ├── codecs.h │ ├── compile.h │ ├── complexobject.h │ ├── datetime.h │ ├── descrobject.h │ ├── dictobject.h │ ├── dtoa.h │ ├── enumobject.h │ ├── errcode.h │ ├── eval.h │ ├── fileobject.h │ ├── floatobject.h │ ├── frameobject.h │ ├── funcobject.h │ ├── genobject.h │ ├── graminit.h │ ├── grammar.h │ ├── import.h │ ├── intobject.h │ ├── intrcheck.h │ ├── iterobject.h │ ├── listobject.h │ ├── longintrepr.h │ ├── longobject.h │ ├── marshal.h │ ├── memoryobject.h │ ├── metagrammar.h │ ├── methodobject.h │ ├── modsupport.h │ ├── moduleobject.h │ ├── node.h │ ├── object.h │ ├── objimpl.h │ ├── opcode.h │ ├── osdefs.h │ ├── parsetok.h │ ├── patchlevel.h │ ├── pgen.h │ ├── pgenheaders.h │ ├── py_curses.h │ ├── pyarena.h │ ├── pycapsule.h │ ├── pyctype.h │ ├── pydebug.h │ ├── pyerrors.h │ ├── pyexpat.h │ ├── pyfpe.h │ ├── pygetopt.h │ ├── pymacconfig.h │ ├── pymactoolbox.h │ ├── pymath.h │ ├── pymem.h │ ├── pyport.h │ ├── pystate.h │ ├── pystrcmp.h │ ├── pystrtod.h │ ├── pythonrun.h │ ├── pythread.h │ ├── rangeobject.h │ ├── setobject.h │ ├── sliceobject.h │ ├── stringobject.h │ ├── structmember.h │ ├── structseq.h │ ├── symtable.h │ ├── sysmodule.h │ ├── timefuncs.h │ ├── token.h │ ├── traceback.h │ ├── tupleobject.h │ ├── ucnhash.h │ ├── unicodeobject.h │ ├── warnings.h │ └── weakrefobject.h │ ├── Modules │ ├── Setup.config.in │ ├── Setup.dist │ ├── _bisectmodule.c │ ├── _bsddb.c │ ├── _codecsmodule.c │ ├── _collectionsmodule.c │ ├── _csv.c │ ├── _ctypes │ │ ├── _ctypes.c │ │ ├── _ctypes_test.c │ │ ├── _ctypes_test.h │ │ ├── callbacks.c │ │ ├── callproc.c │ │ ├── cfield.c │ │ ├── ctypes.h │ │ ├── ctypes_dlfcn.h │ │ ├── libffi.diff │ │ ├── libffi │ │ │ ├── .gitignore │ │ │ ├── include │ │ │ │ ├── ffi.h │ │ │ │ ├── ffi.h.in │ │ │ │ ├── ffi_cfi.h │ │ │ │ └── ffi_common.h │ │ │ └── src │ │ │ │ ├── closures.c │ │ │ │ ├── prep_cif.c │ │ │ │ └── x86 │ │ │ │ ├── asmnames.h │ │ │ │ ├── ffi.c │ │ │ │ ├── ffi64.c │ │ │ │ ├── ffitarget.h │ │ │ │ ├── ffiw64.c │ │ │ │ ├── internal.h │ │ │ │ ├── internal64.h │ │ │ │ ├── sysv.S │ │ │ │ ├── unix64.S │ │ │ │ └── win64.S │ │ ├── malloc_closure.c │ │ └── stgdict.c │ ├── _curses_panel.c │ ├── _cursesmodule.c │ ├── _elementtree.c │ ├── _functoolsmodule.c │ ├── _hashopenssl.c │ ├── _heapqmodule.c │ ├── _hotshot.c │ ├── _io │ │ ├── _iomodule.c │ │ ├── _iomodule.h │ │ ├── bufferedio.c │ │ ├── bytesio.c │ │ ├── fileio.c │ │ ├── iobase.c │ │ ├── stringio.c │ │ └── textio.c │ ├── _json.c │ ├── _localemodule.c │ ├── _lsprof.c │ ├── _math.c │ ├── _math.h │ ├── _multiprocessing │ │ ├── connection.h │ │ ├── multiprocessing.c │ │ ├── multiprocessing.h │ │ ├── pipe_connection.c │ │ ├── semaphore.c │ │ ├── socket_connection.c │ │ └── win32_functions.c │ ├── _randommodule.c │ ├── _sqlite │ │ ├── cache.c │ │ ├── cache.h │ │ ├── connection.c │ │ ├── connection.h │ │ ├── cursor.c │ │ ├── cursor.h │ │ ├── microprotocols.c │ │ ├── microprotocols.h │ │ ├── module.c │ │ ├── module.h │ │ ├── prepare_protocol.c │ │ ├── prepare_protocol.h │ │ ├── row.c │ │ ├── row.h │ │ ├── sqlitecompat.h │ │ ├── statement.c │ │ ├── statement.h │ │ ├── util.c │ │ └── util.h │ ├── _sre.c │ ├── _ssl.c │ ├── _ssl_data.h │ ├── _struct.c │ ├── _testcapimodule.c │ ├── _tkinter.c │ ├── _weakref.c │ ├── addrinfo.h │ ├── almodule.c │ ├── ar_beos │ ├── arraymodule.c │ ├── audioop.c │ ├── binascii.c │ ├── bsddb.h │ ├── bsddbmodule.c │ ├── bz2module.c │ ├── cPickle.c │ ├── cStringIO.c │ ├── cdmodule.c │ ├── cgen.py │ ├── cgensupport.c │ ├── cgensupport.h │ ├── cjkcodecs │ │ ├── README │ │ ├── _codecs_cn.c │ │ ├── _codecs_hk.c │ │ ├── _codecs_iso2022.c │ │ ├── _codecs_jp.c │ │ ├── _codecs_kr.c │ │ ├── _codecs_tw.c │ │ ├── alg_jisx0201.h │ │ ├── cjkcodecs.h │ │ ├── emu_jisx0213_2000.h │ │ ├── mappings_cn.h │ │ ├── mappings_hk.h │ │ ├── mappings_jisx0213_pair.h │ │ ├── mappings_jp.h │ │ ├── mappings_kr.h │ │ ├── mappings_tw.h │ │ ├── multibytecodec.c │ │ └── multibytecodec.h │ ├── clmodule.c │ ├── cmathmodule.c │ ├── config.c.in │ ├── cryptmodule.c │ ├── cstubs │ ├── datetimemodule.c │ ├── dbmmodule.c │ ├── dlmodule.c │ ├── errnomodule.c │ ├── expat │ │ ├── COPYING │ │ ├── ascii.h │ │ ├── asciitab.h │ │ ├── expat.h │ │ ├── expat_config.h │ │ ├── expat_external.h │ │ ├── iasciitab.h │ │ ├── internal.h │ │ ├── latin1tab.h │ │ ├── loadlibrary.c │ │ ├── nametab.h │ │ ├── pyexpatns.h │ │ ├── siphash.h │ │ ├── utf8tab.h │ │ ├── winconfig.h │ │ ├── xmlparse.c │ │ ├── xmlrole.c │ │ ├── xmlrole.h │ │ ├── xmltok.c │ │ ├── xmltok.h │ │ ├── xmltok_impl.c │ │ ├── xmltok_impl.h │ │ └── xmltok_ns.c │ ├── fcntlmodule.c │ ├── flmodule.c │ ├── fmmodule.c │ ├── fpectlmodule.c │ ├── fpetestmodule.c │ ├── future_builtins.c │ ├── gc_weakref.txt │ ├── gcmodule.c │ ├── gdbmmodule.c │ ├── getaddrinfo.c │ ├── getbuildinfo.c │ ├── getnameinfo.c │ ├── getpath.c │ ├── glmodule.c │ ├── grpmodule.c │ ├── imageop.c │ ├── imgfile.c │ ├── itertoolsmodule.c │ ├── ld_so_aix.in │ ├── ld_so_beos │ ├── linuxaudiodev.c │ ├── main.c │ ├── makesetup │ ├── makexp_aix │ ├── mathmodule.c │ ├── md5.c │ ├── md5.h │ ├── md5module.c │ ├── mmapmodule.c │ ├── nismodule.c │ ├── operator.c │ ├── ossaudiodev.c │ ├── parsermodule.c │ ├── posixmodule.c │ ├── posixmodule.h │ ├── puremodule.c │ ├── pwdmodule.c │ ├── pyexpat.c │ ├── python.c │ ├── readline.c │ ├── resource.c │ ├── rotatingtree.c │ ├── rotatingtree.h │ ├── selectmodule.c │ ├── sgimodule.c │ ├── sha256module.c │ ├── sha512module.c │ ├── shamodule.c │ ├── signalmodule.c │ ├── socketmodule.c │ ├── socketmodule.h │ ├── spwdmodule.c │ ├── sre.h │ ├── sre_constants.h │ ├── stropmodule.c │ ├── sunaudiodev.c │ ├── svmodule.c │ ├── symtablemodule.c │ ├── syslogmodule.c │ ├── termios.c │ ├── testcapi_long.h │ ├── threadmodule.c │ ├── timemodule.c │ ├── timing.h │ ├── timingmodule.c │ ├── tkappinit.c │ ├── tkinter.h │ ├── unicodedata.c │ ├── unicodedata_db.h │ ├── unicodename_db.h │ ├── xxmodule.c │ ├── xxsubtype.c │ ├── yuv.h │ ├── yuvconvert.c │ ├── zipimport.c │ ├── zlib │ │ ├── ChangeLog │ │ ├── FAQ │ │ ├── INDEX │ │ ├── README │ │ ├── adler32.c │ │ ├── algorithm.txt │ │ ├── compress.c │ │ ├── crc32.c │ │ ├── crc32.h │ │ ├── deflate.c │ │ ├── deflate.h │ │ ├── example.c │ │ ├── gzclose.c │ │ ├── gzguts.h │ │ ├── gzlib.c │ │ ├── gzread.c │ │ ├── gzwrite.c │ │ ├── infback.c │ │ ├── inffast.c │ │ ├── inffast.h │ │ ├── inffixed.h │ │ ├── inflate.c │ │ ├── inflate.h │ │ ├── inftrees.c │ │ ├── inftrees.h │ │ ├── make_vms.com │ │ ├── minigzip.c │ │ ├── trees.c │ │ ├── trees.h │ │ ├── uncompr.c │ │ ├── zconf.h │ │ ├── zconf.h.cmakein │ │ ├── zconf.h.in │ │ ├── zlib.3 │ │ ├── zlib.h │ │ ├── zlib.map │ │ ├── zlib.pc.in │ │ ├── zutil.c │ │ └── zutil.h │ └── zlibmodule.c │ ├── Objects │ ├── abstract.c │ ├── boolobject.c │ ├── bufferobject.c │ ├── bytearrayobject.c │ ├── bytes_methods.c │ ├── capsule.c │ ├── cellobject.c │ ├── classobject.c │ ├── cobject.c │ ├── codeobject.c │ ├── complexobject.c │ ├── descrobject.c │ ├── dictnotes.txt │ ├── dictobject.c │ ├── enumobject.c │ ├── exceptions.c │ ├── fileobject.c │ ├── floatobject.c │ ├── frameobject.c │ ├── funcobject.c │ ├── genobject.c │ ├── intobject.c │ ├── iterobject.c │ ├── listobject.c │ ├── listsort.txt │ ├── lnotab_notes.txt │ ├── longobject.c │ ├── memoryobject.c │ ├── methodobject.c │ ├── moduleobject.c │ ├── object.c │ ├── obmalloc.c │ ├── rangeobject.c │ ├── setobject.c │ ├── sliceobject.c │ ├── stringlib │ │ ├── README.txt │ │ ├── count.h │ │ ├── ctype.h │ │ ├── fastsearch.h │ │ ├── find.h │ │ ├── formatter.h │ │ ├── localeutil.h │ │ ├── partition.h │ │ ├── split.h │ │ ├── string_format.h │ │ ├── stringdefs.h │ │ ├── transmogrify.h │ │ └── unicodedefs.h │ ├── stringobject.c │ ├── structseq.c │ ├── tupleobject.c │ ├── typeobject.c │ ├── unicodectype.c │ ├── unicodeobject.c │ ├── unicodetype_db.h │ └── weakrefobject.c │ ├── Parser │ ├── Python.asdl │ ├── acceler.c │ ├── asdl.py │ ├── asdl_c.py │ ├── bitset.c │ ├── firstsets.c │ ├── grammar.c │ ├── grammar1.c │ ├── intrcheck.c │ ├── listnode.c │ ├── metagrammar.c │ ├── myreadline.c │ ├── node.c │ ├── parser.c │ ├── parser.h │ ├── parsetok.c │ ├── pgen.c │ ├── pgenmain.c │ ├── printgrammar.c │ ├── spark.py │ ├── tokenizer.c │ ├── tokenizer.h │ └── tokenizer_pgen.c │ └── Python │ ├── Python-ast.c │ ├── _warnings.c │ ├── asdl.c │ ├── ast.c │ ├── atof.c │ ├── bltinmodule.c │ ├── ceval.c │ ├── codecs.c │ ├── compile.c │ ├── dtoa.c │ ├── dup2.c │ ├── dynload_aix.c │ ├── dynload_atheos.c │ ├── dynload_beos.c │ ├── dynload_dl.c │ ├── dynload_hpux.c │ ├── dynload_next.c │ ├── dynload_os2.c │ ├── dynload_shlib.c │ ├── dynload_stub.c │ ├── dynload_win.c │ ├── errors.c │ ├── formatter_string.c │ ├── formatter_unicode.c │ ├── frozen.c │ ├── frozenmain.c │ ├── future.c │ ├── getargs.c │ ├── getcompiler.c │ ├── getcopyright.c │ ├── getcwd.c │ ├── getopt.c │ ├── getplatform.c │ ├── getversion.c │ ├── graminit.c │ ├── import.c │ ├── importdl.c │ ├── importdl.h │ ├── mactoolboxglue.c │ ├── makeopcodetargets.py │ ├── marshal.c │ ├── modsupport.c │ ├── mysnprintf.c │ ├── mystrtoul.c │ ├── opcode_targets.h │ ├── peephole.c │ ├── pyarena.c │ ├── pyctype.c │ ├── pyfpe.c │ ├── pymath.c │ ├── pystate.c │ ├── pystrcmp.c │ ├── pystrtod.c │ ├── pythonrun.c │ ├── random.c │ ├── sigcheck.c │ ├── strdup.c │ ├── strtod.c │ ├── structmember.c │ ├── symtable.c │ ├── sysmodule.c │ ├── thread.c │ ├── thread_atheos.h │ ├── thread_beos.h │ ├── thread_cthread.h │ ├── thread_foobar.h │ ├── thread_lwp.h │ ├── thread_nt.h │ ├── thread_os2.h │ ├── thread_pth.h │ ├── thread_pthread.h │ ├── thread_sgi.h │ ├── thread_solaris.h │ ├── thread_wince.h │ └── traceback.c ├── bits ├── 0001-remove-fdlibm-and-disable-floating-point.patch ├── Makefile.core.def ├── acpica │ ├── acenv.h │ ├── acgrub2.h │ ├── acpica.c │ ├── acpica.h │ └── osgrub2xf.c ├── bitsutil │ └── bitsutil.c ├── include │ ├── bitsutil.h │ ├── compat.h │ ├── datatype.h │ ├── portable.h │ ├── smp.h │ ├── smprc.h │ └── stdint.h ├── mcu │ ├── mcu.c │ └── mcu.h ├── python │ ├── acpimodule.c │ ├── acpimodule.h │ ├── assert.h │ ├── bitsmodule.c │ ├── bitsmodule.h │ ├── compat.c │ ├── config.c │ ├── ctype.h │ ├── dlfcn.h │ ├── efimodule.c │ ├── efimodule.h │ ├── errno.h │ ├── fcntl.h │ ├── fficonfig.h │ ├── grubunconfig.h │ ├── limits.h │ ├── locale.h │ ├── math.h │ ├── pyconfig.h │ ├── pyfsmodule.c │ ├── pyfsmodule.h │ ├── python.c │ ├── pyunconfig.h │ ├── smpmodule.c │ ├── smpmodule.h │ ├── stdio.h │ ├── stdlib.h │ ├── string.h │ ├── sys │ │ └── types.h │ ├── time.h │ └── wchar.h └── smp │ ├── barrier.c │ ├── barrier.h │ ├── smp.c │ ├── smpasm.S │ ├── smpasm.h │ ├── smpequ.h │ └── smprc.c ├── cachetest ├── Makefile.core.def ├── README.md ├── cachetest.c └── cachetest.h ├── chip8 ├── CHIP8ROM.ROM ├── LICENCE ├── Makefile.core.def ├── c8display.c ├── c8display.h ├── c8fs.c ├── c8fs.h ├── c8input.c ├── c8input.h ├── c8interpreter.c ├── c8interpreter.h ├── c8opcodes.h ├── c8rom.h ├── c8sound.c ├── c8sound.h ├── debug.h └── main.c ├── deepin_gfxmode ├── LICENCE ├── Makefile.core.def └── deepin_gfxmode.c ├── fwconfig ├── LICENCE ├── Makefile.core.def └── fwconfig.c ├── gameboy ├── LICENCE ├── Makefile.core.def ├── README ├── core │ ├── bits.h │ ├── cpu.c │ ├── cpu.h │ ├── disasm.c │ ├── disasm.h │ ├── emu.c │ ├── emu.h │ ├── graphics.c │ ├── graphics.h │ ├── interrupts.c │ ├── interrupts.h │ ├── lcd.c │ ├── lcd.h │ ├── memory_layout.h │ ├── mmu │ │ ├── hdma.c │ │ ├── hdma.h │ │ ├── huc1.c │ │ ├── huc1.h │ │ ├── huc3.c │ │ ├── huc3.h │ │ ├── mbc.c │ │ ├── mbc.h │ │ ├── mbc0.c │ │ ├── mbc0.h │ │ ├── mbc1.c │ │ ├── mbc1.h │ │ ├── mbc2.c │ │ ├── mbc2.h │ │ ├── mbc3.c │ │ ├── mbc3.h │ │ ├── mbc5.c │ │ ├── mbc5.h │ │ ├── memory.c │ │ ├── memory.h │ │ ├── mmm01.c │ │ └── mmm01.h │ ├── rom_info.c │ ├── rom_info.h │ ├── serial_io.c │ ├── serial_io.h │ ├── sound.h │ ├── sprite_priorities.c │ ├── sprite_priorities.h │ ├── timers.c │ └── timers.h ├── non_core │ ├── debugger.h │ ├── files.h │ ├── framerate.h │ ├── get_time.h │ ├── graphics_out.h │ ├── joypad.h │ ├── logger.h │ └── serial_io_transfer.h ├── platforms │ ├── debugger.c │ ├── files.c │ ├── libs.c │ ├── libs.h │ ├── logger.c │ ├── main.c │ └── time.h └── shared_libs │ ├── framerate.c │ ├── graphics.c │ ├── joypad.c │ ├── serial_io.c │ └── sound.c ├── goprotate ├── GopRotate.efi ├── Makefile.core.def └── goprotate.c ├── hello ├── Makefile.core.def └── hello.c ├── hwmatch ├── LICENCE ├── Makefile.core.def └── hwmatch.c ├── ntldr-img ├── .gitignore ├── COPYING ├── Makefile.core.common ├── Makefile.core.def ├── README ├── bin2h.c ├── g2hdr.S ├── grldrstart.S ├── grubinst.c ├── ntfsbs.S ├── utils.c ├── utils.h └── version.h ├── peinfo ├── Makefile.core.def └── peinfo.c ├── pong ├── LICENCE ├── Makefile.core.def └── pong.c ├── qrcode ├── LICENSE ├── Makefile.core.def ├── qr_consts.h ├── qr_encode.c ├── qr_encode.h └── qrcode.c ├── raiddump ├── LICENSE ├── Makefile.core.def └── raiddump.c ├── sokoban ├── LICENCE ├── Makefile.core.def ├── level.h ├── level │ ├── 1.txt │ ├── 10.txt │ ├── 11.txt │ ├── 12.txt │ ├── 13.txt │ ├── 14.txt │ ├── 15.txt │ ├── 16.txt │ ├── 17.txt │ ├── 18.txt │ ├── 19.txt │ ├── 2.txt │ ├── 20.txt │ ├── 21.txt │ ├── 22.txt │ ├── 23.txt │ ├── 24.txt │ ├── 25.txt │ ├── 26.txt │ ├── 27.txt │ ├── 28.txt │ ├── 29.txt │ ├── 3.txt │ ├── 30.txt │ ├── 31.txt │ ├── 32.txt │ ├── 33.txt │ ├── 34.txt │ ├── 4.txt │ ├── 5.txt │ ├── 6.txt │ ├── 7.txt │ ├── 8.txt │ └── 9.txt └── sokoban.c └── vdisk ├── LICENCE ├── Makefile.core.def ├── vdisk.c ├── vdiskctl.c ├── vfs.c └── vfs.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | .deps-util 5 | .deps-core 6 | .dirstamp 7 | disabled 8 | -------------------------------------------------------------------------------- /915resolution/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = '915resolution'; 5 | i386_pc = contrib/915resolution/915resolution.c; 6 | enable = i386_pc; 7 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NOTICE: THIS REPOSITORY IS DEPRECATED 2 | 3 | grub-extras is meant to be used as an overlay on grub2 source tree. 4 | 5 | Build instructions: 6 | 7 | - Copy grub-extras in a subdirectory of your grub2 checkout. 8 | For example, "grub-extras". 9 | 10 | - Export GRUB_CONTRIB environment variable to point to this directory. 11 | 12 | - Build GRUB as usual. 13 | -------------------------------------------------------------------------------- /android/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = android; 5 | common = contrib/android/android.c; 6 | enable = x86; 7 | }; 8 | -------------------------------------------------------------------------------- /apple_gmux/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = 'apple_gmux'; 5 | common = contrib/apple_gmux/apple_gmux.c; 6 | enable = x86; 7 | }; 8 | -------------------------------------------------------------------------------- /bits-deps/python/.gitattributes: -------------------------------------------------------------------------------- 1 | # Binary data types 2 | *.aif binary 3 | *.aifc binary 4 | *.aiff binary 5 | *.au binary 6 | *.bmp binary 7 | *.db binary 8 | *.exe binary 9 | *.icns binary 10 | *.gif binary 11 | *.ico binary 12 | *.jpg binary 13 | *.pck binary 14 | *.png binary 15 | *.tar binary 16 | *.wav binary 17 | *.whl binary 18 | *.zip binary 19 | 20 | # Specific binary files 21 | Lib/test/sndhdrdata/sndhdr.* binary 22 | 23 | # Text files that should not be subject to eol conversion 24 | Lib/test/cjkencodings/* -text 25 | Lib/test/decimaltestdata/*.decTest -text 26 | Lib/email/test/data/*.txt -text 27 | Lib/test/xmltestdata/* -text 28 | 29 | # Special files in third party code 30 | Modules/zlib/zlib.map -text 31 | 32 | # CRLF files 33 | *.bat text eol=crlf 34 | *.ps1 text eol=crlf 35 | *.sln text eol=crlf 36 | *.vcxproj* text eol=crlf 37 | *.vcproj text eol=crlf 38 | *.vsprops text eol=crlf 39 | *.props text eol=crlf 40 | *.proj text eol=crlf 41 | PCbuild/readme.txt text eol=crlf 42 | PC/readme.txt text eol=crlf 43 | -------------------------------------------------------------------------------- /bits-deps/python/.gitignore: -------------------------------------------------------------------------------- 1 | # Two-trick pony for OSX and other case insensitive file systems: 2 | # Ignore ./python binary on Unix but still look into ./Python/ directory. 3 | /python 4 | !/Python/ 5 | *.cover 6 | *.o 7 | *.orig 8 | *.pyc 9 | *.pyd 10 | *.pyo 11 | *.rej 12 | *.swp 13 | *~ 14 | *.gc?? 15 | *.profclang? 16 | *.profraw 17 | *.dyn 18 | Doc/build/ 19 | Doc/tools/docutils/ 20 | Doc/tools/jinja2/ 21 | Doc/tools/pygments/ 22 | Doc/tools/sphinx/ 23 | Lib/lib2to3/*.pickle 24 | Lib/test/data/* 25 | Makefile 26 | Makefile.pre 27 | Misc/python.pc 28 | Modules/Setup 29 | Modules/Setup.config 30 | Modules/Setup.local 31 | Modules/config.c 32 | Modules/ld_so_aix 33 | PC/python_nt*.h 34 | PC/pythonnt_rc*.h 35 | PC/*/*.exe 36 | PC/*/*.exp 37 | PC/*/*.lib 38 | PC/*/*.bsc 39 | PC/*/*.dll 40 | PC/*/*.pdb 41 | PC/*/*.user 42 | PC/*/*.ncb 43 | PC/*/*.suo 44 | PC/*/Win32-temp-* 45 | PC/*/x64-temp-* 46 | PC/*/amd64 47 | PCbuild/*.ilk 48 | PCbuild/*.user 49 | PCbuild/*.suo 50 | PCbuild/*.*sdf 51 | PCbuild/*.bsc 52 | PCbuild/*.dll 53 | PCbuild/*.exe 54 | PCbuild/*.exp 55 | PCbuild/*.lib 56 | PCbuild/*.ncb 57 | PCbuild/*.o 58 | PCbuild/*.pdb 59 | PCbuild/Win32-temp-* 60 | PCbuild/*.VC.db 61 | PCbuild/*.VC.opendb 62 | PCbuild/amd64/ 63 | PCbuild/obj/ 64 | PCbuild/win32/ 65 | Parser/pgen 66 | Parser/pgen.stamp 67 | autom4te.cache 68 | build/ 69 | config.cache 70 | config.log 71 | config.status 72 | libpython*.a 73 | libpython*.so* 74 | libpython*.dylib 75 | libpython*.dll 76 | platform 77 | pybuilddir.txt 78 | pyconfig.h 79 | python$ 80 | python.bat 81 | python.exe 82 | python*-gdb.py 83 | tags 84 | TAGS 85 | .coverage 86 | coverage/ 87 | externals/ 88 | htmlcov/ 89 | gmon.out 90 | -------------------------------------------------------------------------------- /bits-deps/python/Include/asdl.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ASDL_H 2 | #define Py_ASDL_H 3 | 4 | typedef PyObject * identifier; 5 | typedef PyObject * string; 6 | typedef PyObject * object; 7 | 8 | #ifndef __cplusplus 9 | typedef enum {false, true} bool; 10 | #endif 11 | 12 | /* It would be nice if the code generated by asdl_c.py was completely 13 | independent of Python, but it is a goal the requires too much work 14 | at this stage. So, for example, I'll represent identifiers as 15 | interned Python strings. 16 | */ 17 | 18 | /* XXX A sequence should be typed so that its use can be typechecked. */ 19 | 20 | typedef struct { 21 | int size; 22 | void *elements[1]; 23 | } asdl_seq; 24 | 25 | typedef struct { 26 | int size; 27 | int elements[1]; 28 | } asdl_int_seq; 29 | 30 | asdl_seq *asdl_seq_new(int size, PyArena *arena); 31 | asdl_int_seq *asdl_int_seq_new(int size, PyArena *arena); 32 | 33 | #define asdl_seq_GET(S, I) (S)->elements[(I)] 34 | #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size) 35 | #ifdef Py_DEBUG 36 | #define asdl_seq_SET(S, I, V) { \ 37 | int _asdl_i = (I); \ 38 | assert((S) && _asdl_i < (S)->size); \ 39 | (S)->elements[_asdl_i] = (V); \ 40 | } 41 | #else 42 | #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V) 43 | #endif 44 | 45 | #endif /* !Py_ASDL_H */ 46 | -------------------------------------------------------------------------------- /bits-deps/python/Include/ast.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_AST_H 2 | #define Py_AST_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(mod_ty) PyAST_FromNode(const node *, PyCompilerFlags *flags, 8 | const char *, PyArena *); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | #endif /* !Py_AST_H */ 14 | -------------------------------------------------------------------------------- /bits-deps/python/Include/bitset.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_BITSET_H 3 | #define Py_BITSET_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* Bitset interface */ 9 | 10 | #define BYTE char 11 | 12 | typedef BYTE *bitset; 13 | 14 | bitset newbitset(int nbits); 15 | void delbitset(bitset bs); 16 | #define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) 17 | int addbit(bitset bs, int ibit); /* Returns 0 if already set */ 18 | int samebitset(bitset bs1, bitset bs2, int nbits); 19 | void mergebitset(bitset bs1, bitset bs2, int nbits); 20 | 21 | #define BITSPERBYTE (8*sizeof(BYTE)) 22 | #define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) 23 | 24 | #define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) 25 | #define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) 26 | #define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) 27 | #define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | #endif /* !Py_BITSET_H */ 33 | -------------------------------------------------------------------------------- /bits-deps/python/Include/boolobject.h: -------------------------------------------------------------------------------- 1 | /* Boolean object interface */ 2 | 3 | #ifndef Py_BOOLOBJECT_H 4 | #define Py_BOOLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | typedef PyIntObject PyBoolObject; 11 | 12 | PyAPI_DATA(PyTypeObject) PyBool_Type; 13 | 14 | #define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type) 15 | 16 | /* Py_False and Py_True are the only two bools in existence. 17 | Don't forget to apply Py_INCREF() when returning either!!! */ 18 | 19 | /* Don't use these directly */ 20 | PyAPI_DATA(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; 21 | 22 | /* Use these macros */ 23 | #define Py_False ((PyObject *) &_Py_ZeroStruct) 24 | #define Py_True ((PyObject *) &_Py_TrueStruct) 25 | 26 | /* Macros for returning Py_True or Py_False, respectively */ 27 | #define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True 28 | #define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False 29 | 30 | /* Function to return a bool from a C long */ 31 | PyAPI_FUNC(PyObject *) PyBool_FromLong(long); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif /* !Py_BOOLOBJECT_H */ 37 | -------------------------------------------------------------------------------- /bits-deps/python/Include/bufferobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Buffer object interface */ 3 | 4 | /* Note: the object's structure is private */ 5 | 6 | #ifndef Py_BUFFEROBJECT_H 7 | #define Py_BUFFEROBJECT_H 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | 13 | PyAPI_DATA(PyTypeObject) PyBuffer_Type; 14 | 15 | #define PyBuffer_Check(op) (Py_TYPE(op) == &PyBuffer_Type) 16 | 17 | #define Py_END_OF_BUFFER (-1) 18 | 19 | PyAPI_FUNC(PyObject *) PyBuffer_FromObject(PyObject *base, 20 | Py_ssize_t offset, Py_ssize_t size); 21 | PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base, 22 | Py_ssize_t offset, 23 | Py_ssize_t size); 24 | 25 | PyAPI_FUNC(PyObject *) PyBuffer_FromMemory(void *ptr, Py_ssize_t size); 26 | PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t size); 27 | 28 | PyAPI_FUNC(PyObject *) PyBuffer_New(Py_ssize_t size); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif /* !Py_BUFFEROBJECT_H */ 34 | -------------------------------------------------------------------------------- /bits-deps/python/Include/bytesobject.h: -------------------------------------------------------------------------------- 1 | #define PyBytesObject PyStringObject 2 | #define PyBytes_Type PyString_Type 3 | 4 | #define PyBytes_Check PyString_Check 5 | #define PyBytes_CheckExact PyString_CheckExact 6 | #define PyBytes_CHECK_INTERNED PyString_CHECK_INTERNED 7 | #define PyBytes_AS_STRING PyString_AS_STRING 8 | #define PyBytes_GET_SIZE PyString_GET_SIZE 9 | #define Py_TPFLAGS_BYTES_SUBCLASS Py_TPFLAGS_STRING_SUBCLASS 10 | 11 | #define PyBytes_FromStringAndSize PyString_FromStringAndSize 12 | #define PyBytes_FromString PyString_FromString 13 | #define PyBytes_FromFormatV PyString_FromFormatV 14 | #define PyBytes_FromFormat PyString_FromFormat 15 | #define PyBytes_Size PyString_Size 16 | #define PyBytes_AsString PyString_AsString 17 | #define PyBytes_Repr PyString_Repr 18 | #define PyBytes_Concat PyString_Concat 19 | #define PyBytes_ConcatAndDel PyString_ConcatAndDel 20 | #define _PyBytes_Resize _PyString_Resize 21 | #define _PyBytes_Eq _PyString_Eq 22 | #define PyBytes_Format PyString_Format 23 | #define _PyBytes_FormatLong _PyString_FormatLong 24 | #define PyBytes_DecodeEscape PyString_DecodeEscape 25 | #define _PyBytes_Join _PyString_Join 26 | #define PyBytes_AsStringAndSize PyString_AsStringAndSize 27 | #define _PyBytes_InsertThousandsGrouping _PyString_InsertThousandsGrouping 28 | -------------------------------------------------------------------------------- /bits-deps/python/Include/cellobject.h: -------------------------------------------------------------------------------- 1 | /* Cell object interface */ 2 | 3 | #ifndef Py_CELLOBJECT_H 4 | #define Py_CELLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef struct { 10 | PyObject_HEAD 11 | PyObject *ob_ref; /* Content of the cell or NULL when empty */ 12 | } PyCellObject; 13 | 14 | PyAPI_DATA(PyTypeObject) PyCell_Type; 15 | 16 | #define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type) 17 | 18 | PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); 19 | PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); 20 | PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); 21 | 22 | #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) 23 | #define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_TUPLEOBJECT_H */ 29 | -------------------------------------------------------------------------------- /bits-deps/python/Include/compile.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_COMPILE_H 3 | #define Py_COMPILE_H 4 | 5 | #include "code.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | /* Public interface */ 12 | struct _node; /* Declare the existence of this type */ 13 | PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *); 14 | 15 | /* Future feature support */ 16 | 17 | typedef struct { 18 | int ff_features; /* flags set by future statements */ 19 | int ff_lineno; /* line number of last future statement */ 20 | } PyFutureFeatures; 21 | 22 | #define FUTURE_NESTED_SCOPES "nested_scopes" 23 | #define FUTURE_GENERATORS "generators" 24 | #define FUTURE_DIVISION "division" 25 | #define FUTURE_ABSOLUTE_IMPORT "absolute_import" 26 | #define FUTURE_WITH_STATEMENT "with_statement" 27 | #define FUTURE_PRINT_FUNCTION "print_function" 28 | #define FUTURE_UNICODE_LITERALS "unicode_literals" 29 | 30 | 31 | struct _mod; /* Declare the existence of this type */ 32 | PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *, 33 | PyCompilerFlags *, PyArena *); 34 | PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif /* !Py_COMPILE_H */ 41 | -------------------------------------------------------------------------------- /bits-deps/python/Include/complexobject.h: -------------------------------------------------------------------------------- 1 | /* Complex number structure */ 2 | 3 | #ifndef Py_COMPLEXOBJECT_H 4 | #define Py_COMPLEXOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef struct { 10 | double real; 11 | double imag; 12 | } Py_complex; 13 | 14 | /* Operations on complex numbers from complexmodule.c */ 15 | 16 | #define c_sum _Py_c_sum 17 | #define c_diff _Py_c_diff 18 | #define c_neg _Py_c_neg 19 | #define c_prod _Py_c_prod 20 | #define c_quot _Py_c_quot 21 | #define c_pow _Py_c_pow 22 | #define c_abs _Py_c_abs 23 | 24 | PyAPI_FUNC(Py_complex) c_sum(Py_complex, Py_complex); 25 | PyAPI_FUNC(Py_complex) c_diff(Py_complex, Py_complex); 26 | PyAPI_FUNC(Py_complex) c_neg(Py_complex); 27 | PyAPI_FUNC(Py_complex) c_prod(Py_complex, Py_complex); 28 | PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex); 29 | PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex); 30 | PyAPI_FUNC(double) c_abs(Py_complex); 31 | 32 | 33 | /* Complex object interface */ 34 | 35 | /* 36 | PyComplexObject represents a complex number with double-precision 37 | real and imaginary parts. 38 | */ 39 | 40 | typedef struct { 41 | PyObject_HEAD 42 | Py_complex cval; 43 | } PyComplexObject; 44 | 45 | PyAPI_DATA(PyTypeObject) PyComplex_Type; 46 | 47 | #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type) 48 | #define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type) 49 | 50 | PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex); 51 | PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag); 52 | 53 | PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op); 54 | PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op); 55 | PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op); 56 | 57 | /* Format the object based on the format_spec, as defined in PEP 3101 58 | (Advanced String Formatting). */ 59 | PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj, 60 | char *format_spec, 61 | Py_ssize_t format_spec_len); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | #endif /* !Py_COMPLEXOBJECT_H */ 67 | -------------------------------------------------------------------------------- /bits-deps/python/Include/dtoa.h: -------------------------------------------------------------------------------- 1 | #ifndef PY_NO_SHORT_FLOAT_REPR 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | 6 | PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr); 7 | PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits, 8 | int *decpt, int *sign, char **rve); 9 | PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); 10 | 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /bits-deps/python/Include/enumobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ENUMOBJECT_H 2 | #define Py_ENUMOBJECT_H 3 | 4 | /* Enumerate Object */ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_DATA(PyTypeObject) PyEnum_Type; 11 | PyAPI_DATA(PyTypeObject) PyReversed_Type; 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif /* !Py_ENUMOBJECT_H */ 18 | -------------------------------------------------------------------------------- /bits-deps/python/Include/errcode.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ERRCODE_H 2 | #define Py_ERRCODE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Error codes passed around between file input, tokenizer, parser and 9 | interpreter. This is necessary so we can turn them into Python 10 | exceptions at a higher level. Note that some errors have a 11 | slightly different meaning when passed from the tokenizer to the 12 | parser than when passed from the parser to the interpreter; e.g. 13 | the parser only returns E_EOF when it hits EOF immediately, and it 14 | never returns E_OK. */ 15 | 16 | #define E_OK 10 /* No error */ 17 | #define E_EOF 11 /* End Of File */ 18 | #define E_INTR 12 /* Interrupted */ 19 | #define E_TOKEN 13 /* Bad token */ 20 | #define E_SYNTAX 14 /* Syntax error */ 21 | #define E_NOMEM 15 /* Ran out of memory */ 22 | #define E_DONE 16 /* Parsing complete */ 23 | #define E_ERROR 17 /* Execution error */ 24 | #define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */ 25 | #define E_OVERFLOW 19 /* Node had too many children */ 26 | #define E_TOODEEP 20 /* Too many indentation levels */ 27 | #define E_DEDENT 21 /* No matching outer block for dedent */ 28 | #define E_DECODE 22 /* Error in decoding into Unicode */ 29 | #define E_EOFS 23 /* EOF in triple-quoted string */ 30 | #define E_EOLS 24 /* EOL in single-quoted string */ 31 | #define E_LINECONT 25 /* Unexpected characters after a line continuation */ 32 | #define E_IO 26 /* I/O error */ 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | #endif /* !Py_ERRCODE_H */ 38 | -------------------------------------------------------------------------------- /bits-deps/python/Include/eval.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface to execute compiled code */ 3 | 4 | #ifndef Py_EVAL_H 5 | #define Py_EVAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *); 11 | 12 | PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co, 13 | PyObject *globals, 14 | PyObject *locals, 15 | PyObject **args, int argc, 16 | PyObject **kwds, int kwdc, 17 | PyObject **defs, int defc, 18 | PyObject *closure); 19 | 20 | PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif /* !Py_EVAL_H */ 26 | -------------------------------------------------------------------------------- /bits-deps/python/Include/genobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Generator object interface */ 3 | 4 | #ifndef Py_GENOBJECT_H 5 | #define Py_GENOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | struct _frame; /* Avoid including frameobject.h */ 11 | 12 | typedef struct { 13 | PyObject_HEAD 14 | /* The gi_ prefix is intended to remind of generator-iterator. */ 15 | 16 | /* Note: gi_frame can be NULL if the generator is "finished" */ 17 | struct _frame *gi_frame; 18 | 19 | /* True if generator is being executed. */ 20 | int gi_running; 21 | 22 | /* The code object backing the generator */ 23 | PyObject *gi_code; 24 | 25 | /* List of weak reference. */ 26 | PyObject *gi_weakreflist; 27 | } PyGenObject; 28 | 29 | PyAPI_DATA(PyTypeObject) PyGen_Type; 30 | 31 | #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) 32 | #define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type) 33 | 34 | PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *); 35 | PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif /* !Py_GENOBJECT_H */ 41 | -------------------------------------------------------------------------------- /bits-deps/python/Include/intrcheck.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_INTRCHECK_H 3 | #define Py_INTRCHECK_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_InterruptOccurred(void); 9 | PyAPI_FUNC(void) PyOS_InitInterrupts(void); 10 | PyAPI_FUNC(void) PyOS_AfterFork(void); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | #endif /* !Py_INTRCHECK_H */ 16 | -------------------------------------------------------------------------------- /bits-deps/python/Include/iterobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ITEROBJECT_H 2 | #define Py_ITEROBJECT_H 3 | /* Iterators (the basic kind, over a sequence) */ 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(PyTypeObject) PySeqIter_Type; 9 | 10 | #define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type) 11 | 12 | PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *); 13 | 14 | PyAPI_DATA(PyTypeObject) PyCallIter_Type; 15 | 16 | #define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type) 17 | 18 | PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *); 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif /* !Py_ITEROBJECT_H */ 23 | 24 | -------------------------------------------------------------------------------- /bits-deps/python/Include/marshal.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface for marshal.c */ 3 | 4 | #ifndef Py_MARSHAL_H 5 | #define Py_MARSHAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define Py_MARSHAL_VERSION 2 11 | 12 | PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int); 13 | PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int); 14 | PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int); 15 | 16 | PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *); 17 | PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *); 18 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *); 19 | PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *); 20 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif /* !Py_MARSHAL_H */ 26 | -------------------------------------------------------------------------------- /bits-deps/python/Include/metagrammar.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_METAGRAMMAR_H 2 | #define Py_METAGRAMMAR_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | #define MSTART 256 9 | #define RULE 257 10 | #define RHS 258 11 | #define ALT 259 12 | #define ITEM 260 13 | #define ATOM 261 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_METAGRAMMAR_H */ 19 | -------------------------------------------------------------------------------- /bits-deps/python/Include/moduleobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Module object interface */ 3 | 4 | #ifndef Py_MODULEOBJECT_H 5 | #define Py_MODULEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_DATA(PyTypeObject) PyModule_Type; 11 | 12 | #define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type) 13 | #define PyModule_CheckExact(op) (Py_TYPE(op) == &PyModule_Type) 14 | 15 | PyAPI_FUNC(PyObject *) PyModule_New(const char *); 16 | PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *); 17 | PyAPI_FUNC(char *) PyModule_GetName(PyObject *); 18 | PyAPI_FUNC(char *) PyModule_GetFilename(PyObject *); 19 | PyAPI_FUNC(void) _PyModule_Clear(PyObject *); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | #endif /* !Py_MODULEOBJECT_H */ 25 | -------------------------------------------------------------------------------- /bits-deps/python/Include/node.h: -------------------------------------------------------------------------------- 1 | 2 | /* Parse tree node interface */ 3 | 4 | #ifndef Py_NODE_H 5 | #define Py_NODE_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct _node { 11 | short n_type; 12 | char *n_str; 13 | int n_lineno; 14 | int n_col_offset; 15 | int n_nchildren; 16 | struct _node *n_child; 17 | } node; 18 | 19 | PyAPI_FUNC(node *) PyNode_New(int type); 20 | PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, 21 | char *str, int lineno, int col_offset); 22 | PyAPI_FUNC(void) PyNode_Free(node *n); 23 | PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); 24 | 25 | /* Node access functions */ 26 | #define NCH(n) ((n)->n_nchildren) 27 | 28 | #define CHILD(n, i) (&(n)->n_child[i]) 29 | #define RCHILD(n, i) (CHILD(n, NCH(n) + i)) 30 | #define TYPE(n) ((n)->n_type) 31 | #define STR(n) ((n)->n_str) 32 | 33 | /* Assert that the type of a node is what we expect */ 34 | #define REQ(n, type) assert(TYPE(n) == (type)) 35 | 36 | PyAPI_FUNC(void) PyNode_ListTree(node *); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* !Py_NODE_H */ 42 | -------------------------------------------------------------------------------- /bits-deps/python/Include/osdefs.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_OSDEFS_H 2 | #define Py_OSDEFS_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Operating system dependencies */ 9 | 10 | /* Mod by chrish: QNX has WATCOM, but isn't DOS */ 11 | #if !defined(__QNX__) 12 | #if defined(MS_WINDOWS) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__DJGPP__) || defined(PYOS_OS2) 13 | #if defined(PYOS_OS2) && defined(PYCC_GCC) 14 | #define MAXPATHLEN 260 15 | #define SEP '/' 16 | #define ALTSEP '\\' 17 | #else 18 | #define SEP '\\' 19 | #define ALTSEP '/' 20 | #define MAXPATHLEN 256 21 | #endif 22 | #define DELIM ';' 23 | #endif 24 | #endif 25 | 26 | #ifdef RISCOS 27 | #define SEP '.' 28 | #define MAXPATHLEN 256 29 | #define DELIM ',' 30 | #endif 31 | 32 | 33 | /* Filename separator */ 34 | #ifndef SEP 35 | #define SEP '/' 36 | #endif 37 | 38 | /* Max pathname length */ 39 | #ifdef __hpux 40 | #include 41 | #include 42 | #ifndef PATH_MAX 43 | #define PATH_MAX MAXPATHLEN 44 | #endif 45 | #endif 46 | 47 | #ifndef MAXPATHLEN 48 | #if defined(PATH_MAX) && PATH_MAX > 1024 49 | #define MAXPATHLEN PATH_MAX 50 | #else 51 | #define MAXPATHLEN 1024 52 | #endif 53 | #endif 54 | 55 | /* Search path entry delimiter */ 56 | #ifndef DELIM 57 | #define DELIM ':' 58 | #endif 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #endif /* !Py_OSDEFS_H */ 64 | -------------------------------------------------------------------------------- /bits-deps/python/Include/parsetok.h: -------------------------------------------------------------------------------- 1 | 2 | /* Parser-tokenizer link interface */ 3 | 4 | #ifndef Py_PARSETOK_H 5 | #define Py_PARSETOK_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct { 11 | int error; 12 | const char *filename; 13 | int lineno; 14 | int offset; 15 | char *text; 16 | int token; 17 | int expected; 18 | } perrdetail; 19 | 20 | #if 0 21 | #define PyPARSE_YIELD_IS_KEYWORD 0x0001 22 | #endif 23 | 24 | #define PyPARSE_DONT_IMPLY_DEDENT 0x0002 25 | 26 | #if 0 27 | #define PyPARSE_WITH_IS_KEYWORD 0x0003 28 | #endif 29 | 30 | #define PyPARSE_PRINT_IS_FUNCTION 0x0004 31 | #define PyPARSE_UNICODE_LITERALS 0x0008 32 | 33 | 34 | 35 | PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int, 36 | perrdetail *); 37 | PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int, 38 | char *, char *, perrdetail *); 39 | 40 | PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int, 41 | perrdetail *, int); 42 | PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, grammar *, 43 | int, char *, char *, 44 | perrdetail *, int); 45 | PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(FILE *, const char *, grammar *, 46 | int, char *, char *, 47 | perrdetail *, int *); 48 | 49 | PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *, 50 | const char *, 51 | grammar *, int, 52 | perrdetail *, int); 53 | PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(const char *, 54 | const char *, 55 | grammar *, int, 56 | perrdetail *, int *); 57 | 58 | /* Note that he following function is defined in pythonrun.c not parsetok.c. */ 59 | PyAPI_FUNC(void) PyParser_SetError(perrdetail *); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | #endif /* !Py_PARSETOK_H */ 65 | -------------------------------------------------------------------------------- /bits-deps/python/Include/patchlevel.h: -------------------------------------------------------------------------------- 1 | 2 | /* Newfangled version identification scheme. 3 | 4 | This scheme was added in Python 1.5.2b2; before that time, only PATCHLEVEL 5 | was available. To test for presence of the scheme, test for 6 | defined(PY_MAJOR_VERSION). 7 | 8 | When the major or minor version changes, the VERSION variable in 9 | configure.ac must also be changed. 10 | 11 | There is also (independent) API version information in modsupport.h. 12 | */ 13 | 14 | /* Values for PY_RELEASE_LEVEL */ 15 | #define PY_RELEASE_LEVEL_ALPHA 0xA 16 | #define PY_RELEASE_LEVEL_BETA 0xB 17 | #define PY_RELEASE_LEVEL_GAMMA 0xC /* For release candidates */ 18 | #define PY_RELEASE_LEVEL_FINAL 0xF /* Serial should be 0 here */ 19 | /* Higher for patch releases */ 20 | 21 | /* Version parsed out into numeric values */ 22 | /*--start constants--*/ 23 | #define PY_MAJOR_VERSION 2 24 | #define PY_MINOR_VERSION 7 25 | #define PY_MICRO_VERSION 16 26 | #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL 27 | #define PY_RELEASE_SERIAL 0 28 | 29 | /* Version as a string */ 30 | #define PY_VERSION "2.7.16+" 31 | /*--end constants--*/ 32 | 33 | /* Subversion Revision number of this file (not of the repository). Empty 34 | since Mercurial migration. */ 35 | #define PY_PATCHLEVEL_REVISION "" 36 | 37 | /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. 38 | Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */ 39 | #define PY_VERSION_HEX ((PY_MAJOR_VERSION << 24) | \ 40 | (PY_MINOR_VERSION << 16) | \ 41 | (PY_MICRO_VERSION << 8) | \ 42 | (PY_RELEASE_LEVEL << 4) | \ 43 | (PY_RELEASE_SERIAL << 0)) 44 | -------------------------------------------------------------------------------- /bits-deps/python/Include/pgen.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_PGEN_H 2 | #define Py_PGEN_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Parser generator interface */ 9 | 10 | extern grammar *meta_grammar(void); 11 | 12 | struct _node; 13 | extern grammar *pgen(struct _node *); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_PGEN_H */ 19 | -------------------------------------------------------------------------------- /bits-deps/python/Include/pgenheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_PGENHEADERS_H 2 | #define Py_PGENHEADERS_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Include files and extern declarations used by most of the parser. */ 9 | 10 | #include "Python.h" 11 | 12 | PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) 13 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 14 | PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) 15 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 16 | 17 | #define addarc _Py_addarc 18 | #define addbit _Py_addbit 19 | #define adddfa _Py_adddfa 20 | #define addfirstsets _Py_addfirstsets 21 | #define addlabel _Py_addlabel 22 | #define addstate _Py_addstate 23 | #define delbitset _Py_delbitset 24 | #define dumptree _Py_dumptree 25 | #define findlabel _Py_findlabel 26 | #define freegrammar _Py_freegrammar 27 | #define mergebitset _Py_mergebitset 28 | #define meta_grammar _Py_meta_grammar 29 | #define newbitset _Py_newbitset 30 | #define newgrammar _Py_newgrammar 31 | #define pgen _Py_pgen 32 | #define printgrammar _Py_printgrammar 33 | #define printnonterminals _Py_printnonterminals 34 | #define printtree _Py_printtree 35 | #define samebitset _Py_samebitset 36 | #define showtree _Py_showtree 37 | #define tok_dump _Py_tok_dump 38 | #define translatelabels _Py_translatelabels 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif /* !Py_PGENHEADERS_H */ 44 | -------------------------------------------------------------------------------- /bits-deps/python/Include/pycapsule.h: -------------------------------------------------------------------------------- 1 | 2 | /* Capsule objects let you wrap a C "void *" pointer in a Python 3 | object. They're a way of passing data through the Python interpreter 4 | without creating your own custom type. 5 | 6 | Capsules are used for communication between extension modules. 7 | They provide a way for an extension module to export a C interface 8 | to other extension modules, so that extension modules can use the 9 | Python import mechanism to link to one another. 10 | 11 | For more information, please see "c-api/capsule.html" in the 12 | documentation. 13 | */ 14 | 15 | #ifndef Py_CAPSULE_H 16 | #define Py_CAPSULE_H 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PyAPI_DATA(PyTypeObject) PyCapsule_Type; 22 | 23 | typedef void (*PyCapsule_Destructor)(PyObject *); 24 | 25 | #define PyCapsule_CheckExact(op) (Py_TYPE(op) == &PyCapsule_Type) 26 | 27 | 28 | PyAPI_FUNC(PyObject *) PyCapsule_New( 29 | void *pointer, 30 | const char *name, 31 | PyCapsule_Destructor destructor); 32 | 33 | PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name); 34 | 35 | PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule); 36 | 37 | PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule); 38 | 39 | PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule); 40 | 41 | PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name); 42 | 43 | PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer); 44 | 45 | PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor); 46 | 47 | PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name); 48 | 49 | PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context); 50 | 51 | PyAPI_FUNC(void *) PyCapsule_Import(const char *name, int no_block); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | #endif /* !Py_CAPSULE_H */ 57 | -------------------------------------------------------------------------------- /bits-deps/python/Include/pyctype.h: -------------------------------------------------------------------------------- 1 | #ifndef PYCTYPE_H 2 | #define PYCTYPE_H 3 | 4 | #define PY_CTF_LOWER 0x01 5 | #define PY_CTF_UPPER 0x02 6 | #define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER) 7 | #define PY_CTF_DIGIT 0x04 8 | #define PY_CTF_ALNUM (PY_CTF_ALPHA|PY_CTF_DIGIT) 9 | #define PY_CTF_SPACE 0x08 10 | #define PY_CTF_XDIGIT 0x10 11 | 12 | PyAPI_DATA(const unsigned int) _Py_ctype_table[256]; 13 | 14 | /* Unlike their C counterparts, the following macros are not meant to 15 | * handle an int with any of the values [EOF, 0-UCHAR_MAX]. The argument 16 | * must be a signed/unsigned char. */ 17 | #define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER) 18 | #define Py_ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER) 19 | #define Py_ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA) 20 | #define Py_ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT) 21 | #define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT) 22 | #define Py_ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM) 23 | #define Py_ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE) 24 | 25 | PyAPI_DATA(const unsigned char) _Py_ctype_tolower[256]; 26 | PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256]; 27 | 28 | #define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) 29 | #define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) 30 | 31 | #endif /* !PYCTYPE_H */ 32 | -------------------------------------------------------------------------------- /bits-deps/python/Include/pydebug.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_PYDEBUG_H 3 | #define Py_PYDEBUG_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(int) Py_DebugFlag; 9 | PyAPI_DATA(int) Py_VerboseFlag; 10 | PyAPI_DATA(int) Py_InteractiveFlag; 11 | PyAPI_DATA(int) Py_InspectFlag; 12 | PyAPI_DATA(int) Py_OptimizeFlag; 13 | PyAPI_DATA(int) Py_NoSiteFlag; 14 | PyAPI_DATA(int) Py_BytesWarningFlag; 15 | PyAPI_DATA(int) Py_UseClassExceptionsFlag; 16 | PyAPI_DATA(int) Py_FrozenFlag; 17 | PyAPI_DATA(int) Py_TabcheckFlag; 18 | PyAPI_DATA(int) Py_UnicodeFlag; 19 | PyAPI_DATA(int) Py_IgnoreEnvironmentFlag; 20 | PyAPI_DATA(int) Py_DivisionWarningFlag; 21 | PyAPI_DATA(int) Py_DontWriteBytecodeFlag; 22 | PyAPI_DATA(int) Py_NoUserSiteDirectory; 23 | /* _XXX Py_QnewFlag should go away in 3.0. It's true iff -Qnew is passed, 24 | on the command line, and is used in 2.2 by ceval.c to make all "/" divisions 25 | true divisions (which they will be in 3.0). */ 26 | PyAPI_DATA(int) _Py_QnewFlag; 27 | /* Warn about 3.x issues */ 28 | PyAPI_DATA(int) Py_Py3kWarningFlag; 29 | PyAPI_DATA(int) Py_HashRandomizationFlag; 30 | 31 | /* this is a wrapper around getenv() that pays attention to 32 | Py_IgnoreEnvironmentFlag. It should be used for getting variables like 33 | PYTHONPATH and PYTHONHOME from the environment */ 34 | #define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s)) 35 | 36 | PyAPI_FUNC(void) Py_FatalError(const char *message); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* !Py_PYDEBUG_H */ 42 | -------------------------------------------------------------------------------- /bits-deps/python/Include/pygetopt.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_PYGETOPT_H 3 | #define Py_PYGETOPT_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(int) _PyOS_opterr; 9 | PyAPI_DATA(int) _PyOS_optind; 10 | PyAPI_DATA(char *) _PyOS_optarg; 11 | 12 | PyAPI_FUNC(void) _PyOS_ResetGetOpt(void); 13 | PyAPI_FUNC(int) _PyOS_GetOpt(int argc, char **argv, char *optstring); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_PYGETOPT_H */ 19 | -------------------------------------------------------------------------------- /bits-deps/python/Include/pystrcmp.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRCMP_H 2 | #define Py_STRCMP_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_mystrnicmp(const char *, const char *, Py_ssize_t); 9 | PyAPI_FUNC(int) PyOS_mystricmp(const char *, const char *); 10 | 11 | #if defined(MS_WINDOWS) || defined(PYOS_OS2) 12 | #define PyOS_strnicmp strnicmp 13 | #define PyOS_stricmp stricmp 14 | #else 15 | #define PyOS_strnicmp PyOS_mystrnicmp 16 | #define PyOS_stricmp PyOS_mystricmp 17 | #endif 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif /* !Py_STRCMP_H */ 24 | -------------------------------------------------------------------------------- /bits-deps/python/Include/pystrtod.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRTOD_H 2 | #define Py_STRTOD_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | PyAPI_FUNC(double) PyOS_ascii_strtod(const char *str, char **ptr); 10 | PyAPI_FUNC(double) PyOS_ascii_atof(const char *str); 11 | 12 | /* Deprecated in 2.7 and 3.1. Will disappear in 2.8 (if it exists) and 3.2 */ 13 | PyAPI_FUNC(char *) PyOS_ascii_formatd(char *buffer, size_t buf_len, 14 | const char *format, double d); 15 | PyAPI_FUNC(double) PyOS_string_to_double(const char *str, 16 | char **endptr, 17 | PyObject *overflow_exception); 18 | 19 | /* The caller is responsible for calling PyMem_Free to free the buffer 20 | that's is returned. */ 21 | PyAPI_FUNC(char *) PyOS_double_to_string(double val, 22 | char format_code, 23 | int precision, 24 | int flags, 25 | int *type); 26 | 27 | PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr); 28 | 29 | 30 | /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */ 31 | #define Py_DTSF_SIGN 0x01 /* always add the sign */ 32 | #define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */ 33 | #define Py_DTSF_ALT 0x04 /* "alternate" formatting. it's format_code 34 | specific */ 35 | 36 | /* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */ 37 | #define Py_DTST_FINITE 0 38 | #define Py_DTST_INFINITE 1 39 | #define Py_DTST_NAN 2 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* !Py_STRTOD_H */ 46 | -------------------------------------------------------------------------------- /bits-deps/python/Include/pythread.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_PYTHREAD_H 3 | #define Py_PYTHREAD_H 4 | 5 | typedef void *PyThread_type_lock; 6 | typedef void *PyThread_type_sema; 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | PyAPI_FUNC(void) PyThread_init_thread(void); 13 | PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *); 14 | PyAPI_FUNC(void) PyThread_exit_thread(void); 15 | PyAPI_FUNC(long) PyThread_get_thread_ident(void); 16 | 17 | PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void); 18 | PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock); 19 | PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int); 20 | #define WAIT_LOCK 1 21 | #define NOWAIT_LOCK 0 22 | PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock); 23 | 24 | PyAPI_FUNC(size_t) PyThread_get_stacksize(void); 25 | PyAPI_FUNC(int) PyThread_set_stacksize(size_t); 26 | 27 | /* Thread Local Storage (TLS) API */ 28 | PyAPI_FUNC(int) PyThread_create_key(void); 29 | PyAPI_FUNC(void) PyThread_delete_key(int); 30 | PyAPI_FUNC(int) PyThread_set_key_value(int, void *); 31 | PyAPI_FUNC(void *) PyThread_get_key_value(int); 32 | PyAPI_FUNC(void) PyThread_delete_key_value(int key); 33 | 34 | /* Cleanup after a fork */ 35 | PyAPI_FUNC(void) PyThread_ReInitTLS(void); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* !Py_PYTHREAD_H */ 42 | -------------------------------------------------------------------------------- /bits-deps/python/Include/rangeobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Range object interface */ 3 | 4 | #ifndef Py_RANGEOBJECT_H 5 | #define Py_RANGEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* This is about the type 'xrange', not the built-in function range(), which 11 | returns regular lists. */ 12 | 13 | /* 14 | A range object represents an integer range. This is an immutable object; 15 | a range cannot change its value after creation. 16 | 17 | Range objects behave like the corresponding tuple objects except that 18 | they are represented by a start, stop, and step datamembers. 19 | */ 20 | 21 | PyAPI_DATA(PyTypeObject) PyRange_Type; 22 | 23 | #define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_RANGEOBJECT_H */ 29 | -------------------------------------------------------------------------------- /bits-deps/python/Include/sliceobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_SLICEOBJECT_H 2 | #define Py_SLICEOBJECT_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | /* The unique ellipsis object "..." */ 8 | 9 | PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */ 10 | 11 | #define Py_Ellipsis (&_Py_EllipsisObject) 12 | 13 | /* Slice object interface */ 14 | 15 | /* 16 | 17 | A slice object containing start, stop, and step data members (the 18 | names are from range). After much talk with Guido, it was decided to 19 | let these be any arbitrary python type. Py_None stands for omitted values. 20 | */ 21 | 22 | typedef struct { 23 | PyObject_HEAD 24 | PyObject *start, *stop, *step; /* not NULL */ 25 | } PySliceObject; 26 | 27 | PyAPI_DATA(PyTypeObject) PySlice_Type; 28 | PyAPI_DATA(PyTypeObject) PyEllipsis_Type; 29 | 30 | #define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type) 31 | 32 | PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop, 33 | PyObject* step); 34 | PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop); 35 | PyAPI_FUNC(int) PySlice_GetIndices(PySliceObject *r, Py_ssize_t length, 36 | Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); 37 | PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length, 38 | Py_ssize_t *start, Py_ssize_t *stop, 39 | Py_ssize_t *step, Py_ssize_t *slicelength); 40 | 41 | PyAPI_FUNC(int) _PySlice_Unpack(PyObject *slice, 42 | Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); 43 | PyAPI_FUNC(Py_ssize_t) _PySlice_AdjustIndices(Py_ssize_t length, 44 | Py_ssize_t *start, Py_ssize_t *stop, 45 | Py_ssize_t step); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | #endif /* !Py_SLICEOBJECT_H */ 51 | -------------------------------------------------------------------------------- /bits-deps/python/Include/structseq.h: -------------------------------------------------------------------------------- 1 | 2 | /* Tuple object interface */ 3 | 4 | #ifndef Py_STRUCTSEQ_H 5 | #define Py_STRUCTSEQ_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct PyStructSequence_Field { 11 | char *name; 12 | char *doc; 13 | } PyStructSequence_Field; 14 | 15 | typedef struct PyStructSequence_Desc { 16 | char *name; 17 | char *doc; 18 | struct PyStructSequence_Field *fields; 19 | int n_in_sequence; 20 | } PyStructSequence_Desc; 21 | 22 | extern char* PyStructSequence_UnnamedField; 23 | 24 | PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, 25 | PyStructSequence_Desc *desc); 26 | 27 | PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); 28 | 29 | typedef struct { 30 | PyObject_VAR_HEAD 31 | PyObject *ob_item[1]; 32 | } PyStructSequence; 33 | 34 | /* Macro, *only* to be used to fill in brand new objects */ 35 | #define PyStructSequence_SET_ITEM(op, i, v) \ 36 | (((PyStructSequence *)(op))->ob_item[i] = v) 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* !Py_STRUCTSEQ_H */ 42 | -------------------------------------------------------------------------------- /bits-deps/python/Include/sysmodule.h: -------------------------------------------------------------------------------- 1 | 2 | /* System module interface */ 3 | 4 | #ifndef Py_SYSMODULE_H 5 | #define Py_SYSMODULE_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_FUNC(PyObject *) PySys_GetObject(char *); 11 | PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *); 12 | PyAPI_FUNC(FILE *) PySys_GetFile(char *, FILE *); 13 | PyAPI_FUNC(void) PySys_SetArgv(int, char **); 14 | PyAPI_FUNC(void) PySys_SetArgvEx(int, char **, int); 15 | PyAPI_FUNC(void) PySys_SetPath(char *); 16 | 17 | PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) 18 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 19 | PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) 20 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 21 | 22 | PyAPI_FUNC(void) PySys_ResetWarnOptions(void); 23 | PyAPI_FUNC(void) PySys_AddWarnOption(char *); 24 | PyAPI_FUNC(int) PySys_HasWarnOptions(void); 25 | 26 | PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* !Py_SYSMODULE_H */ 32 | -------------------------------------------------------------------------------- /bits-deps/python/Include/timefuncs.h: -------------------------------------------------------------------------------- 1 | /* timefuncs.h 2 | */ 3 | 4 | /* Utility function related to timemodule.c. */ 5 | 6 | #ifndef TIMEFUNCS_H 7 | #define TIMEFUNCS_H 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | 13 | /* Cast double x to time_t, but raise ValueError if x is too large 14 | * to fit in a time_t. ValueError is set on return iff the return 15 | * value is (time_t)-1 and PyErr_Occurred(). 16 | */ 17 | PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x); 18 | 19 | /* Get the current time since the epoch in seconds */ 20 | PyAPI_FUNC(double) _PyTime_FloatTime(void); 21 | 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif /* TIMEFUNCS_H */ 27 | -------------------------------------------------------------------------------- /bits-deps/python/Include/traceback.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_TRACEBACK_H 3 | #define Py_TRACEBACK_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | struct _frame; 9 | 10 | /* Traceback interface */ 11 | 12 | typedef struct _traceback { 13 | PyObject_HEAD 14 | struct _traceback *tb_next; 15 | struct _frame *tb_frame; 16 | int tb_lasti; 17 | int tb_lineno; 18 | } PyTracebackObject; 19 | 20 | PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *); 21 | PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *); 22 | PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, const char *, int, int); 23 | 24 | /* Reveal traceback type so we can typecheck traceback objects */ 25 | PyAPI_DATA(PyTypeObject) PyTraceBack_Type; 26 | #define PyTraceBack_Check(v) (Py_TYPE(v) == &PyTraceBack_Type) 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* !Py_TRACEBACK_H */ 32 | -------------------------------------------------------------------------------- /bits-deps/python/Include/ucnhash.h: -------------------------------------------------------------------------------- 1 | /* Unicode name database interface */ 2 | 3 | #ifndef Py_UCNHASH_H 4 | #define Py_UCNHASH_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* revised ucnhash CAPI interface (exported through a "wrapper") */ 10 | 11 | #define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" 12 | 13 | typedef struct { 14 | 15 | /* Size of this struct */ 16 | int size; 17 | 18 | /* Get name for a given character code. Returns non-zero if 19 | success, zero if not. Does not set Python exceptions. 20 | If self is NULL, data come from the default version of the database. 21 | If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ 22 | int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen); 23 | 24 | /* Get character code for a given name. Same error handling 25 | as for getname. */ 26 | int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code); 27 | 28 | } _PyUnicode_Name_CAPI; 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif /* !Py_UCNHASH_H */ 34 | -------------------------------------------------------------------------------- /bits-deps/python/Include/warnings.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_WARNINGS_H 2 | #define Py_WARNINGS_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(void) _PyWarnings_Init(void); 8 | 9 | PyAPI_FUNC(int) PyErr_WarnEx(PyObject *, const char *, Py_ssize_t); 10 | PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, const char *, int, 11 | const char *, PyObject *); 12 | 13 | #define PyErr_WarnPy3k(msg, stacklevel) \ 14 | (Py_Py3kWarningFlag ? PyErr_WarnEx(PyExc_DeprecationWarning, msg, stacklevel) : 0) 15 | 16 | /* DEPRECATED: Use PyErr_WarnEx() instead. */ 17 | #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif /* !Py_WARNINGS_H */ 23 | 24 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/Setup.config.in: -------------------------------------------------------------------------------- 1 | # This file is transmogrified into Setup.config by config.status. 2 | 3 | # The purpose of this file is to conditionally enable certain modules 4 | # based on configure-time options. 5 | 6 | # Threading 7 | @USE_THREAD_MODULE@thread threadmodule.c 8 | 9 | # The signal module 10 | @USE_SIGNAL_MODULE@signal signalmodule.c 11 | 12 | # The rest of the modules previously listed in this file are built 13 | # by the setup.py script in Python 2.1 and later. 14 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/_ctypes/_ctypes_test.h: -------------------------------------------------------------------------------- 1 | extern int _testfunc_i_bhilfd(char b, short h, int i, long l, float f, double d); 2 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/_ctypes/ctypes_dlfcn.h: -------------------------------------------------------------------------------- 1 | #ifndef _CTYPES_DLFCN_H_ 2 | #define _CTYPES_DLFCN_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #ifndef MS_WIN32 9 | 10 | #include 11 | 12 | #ifndef CTYPES_DARWIN_DLFCN 13 | 14 | #define ctypes_dlsym dlsym 15 | #define ctypes_dlerror dlerror 16 | #define ctypes_dlopen dlopen 17 | #define ctypes_dlclose dlclose 18 | #define ctypes_dladdr dladdr 19 | 20 | #endif /* !CTYPES_DARWIN_DLFCN */ 21 | 22 | #endif /* !MS_WIN32 */ 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif /* __cplusplus */ 27 | #endif /* _CTYPES_DLFCN_H_ */ 28 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/_ctypes/libffi/.gitignore: -------------------------------------------------------------------------------- 1 | .libs 2 | .deps 3 | *.o 4 | *.lo 5 | .dirstamp 6 | *.la 7 | Makefile 8 | Makefile.in 9 | aclocal.m4 10 | compile 11 | config.* 12 | configure 13 | depcomp 14 | doc/libffi.info 15 | *~ 16 | fficonfig.h.in 17 | fficonfig.h 18 | include/ffitarget.h 19 | install-sh 20 | libffi.pc 21 | libtool 22 | libtool-ldflags 23 | ltmain.sh 24 | m4/libtool.m4 25 | m4/lt*.m4 26 | mdate-sh 27 | missing 28 | stamp-h1 29 | libffi*gz 30 | autom4te.cache 31 | libffi.xcodeproj/xcuserdata 32 | libffi.xcodeproj/project.xcworkspace 33 | build_*/ 34 | darwin_*/ 35 | src/arm/trampoline.S 36 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/_ctypes/libffi/src/x86/asmnames.h: -------------------------------------------------------------------------------- 1 | #ifndef ASMNAMES_H 2 | #define ASMNAMES_H 3 | 4 | #define C2(X, Y) X ## Y 5 | #define C1(X, Y) C2(X, Y) 6 | #ifdef __USER_LABEL_PREFIX__ 7 | # define C(X) C1(__USER_LABEL_PREFIX__, X) 8 | #else 9 | # define C(X) X 10 | #endif 11 | 12 | #ifdef __APPLE__ 13 | # define L(X) C1(L, X) 14 | #else 15 | # define L(X) C1(.L, X) 16 | #endif 17 | 18 | #if defined(__ELF__) && defined(__PIC__) 19 | # define PLT(X) X@PLT 20 | #else 21 | # define PLT(X) X 22 | #endif 23 | 24 | #ifdef __ELF__ 25 | # define ENDF(X) .type X,@function; .size X, . - X 26 | #else 27 | # define ENDF(X) 28 | #endif 29 | 30 | #endif /* ASMNAMES_H */ 31 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/_ctypes/libffi/src/x86/internal.h: -------------------------------------------------------------------------------- 1 | #define X86_RET_FLOAT 0 2 | #define X86_RET_DOUBLE 1 3 | #define X86_RET_LDOUBLE 2 4 | #define X86_RET_SINT8 3 5 | #define X86_RET_SINT16 4 6 | #define X86_RET_UINT8 5 7 | #define X86_RET_UINT16 6 8 | #define X86_RET_INT64 7 9 | #define X86_RET_INT32 8 10 | #define X86_RET_VOID 9 11 | #define X86_RET_STRUCTPOP 10 12 | #define X86_RET_STRUCTARG 11 13 | #define X86_RET_STRUCT_1B 12 14 | #define X86_RET_STRUCT_2B 13 15 | #define X86_RET_UNUSED14 14 16 | #define X86_RET_UNUSED15 15 17 | 18 | #define X86_RET_TYPE_MASK 15 19 | #define X86_RET_POP_SHIFT 4 20 | 21 | #define R_EAX 0 22 | #define R_EDX 1 23 | #define R_ECX 2 24 | 25 | #ifdef __PCC__ 26 | # define HAVE_FASTCALL 0 27 | #else 28 | # define HAVE_FASTCALL 1 29 | #endif 30 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/_ctypes/libffi/src/x86/internal64.h: -------------------------------------------------------------------------------- 1 | #define UNIX64_RET_VOID 0 2 | #define UNIX64_RET_UINT8 1 3 | #define UNIX64_RET_UINT16 2 4 | #define UNIX64_RET_UINT32 3 5 | #define UNIX64_RET_SINT8 4 6 | #define UNIX64_RET_SINT16 5 7 | #define UNIX64_RET_SINT32 6 8 | #define UNIX64_RET_INT64 7 9 | #define UNIX64_RET_XMM32 8 10 | #define UNIX64_RET_XMM64 9 11 | #define UNIX64_RET_X87 10 12 | #define UNIX64_RET_X87_2 11 13 | #define UNIX64_RET_ST_XMM0_RAX 12 14 | #define UNIX64_RET_ST_RAX_XMM0 13 15 | #define UNIX64_RET_ST_XMM0_XMM1 14 16 | #define UNIX64_RET_ST_RAX_RDX 15 17 | 18 | #define UNIX64_RET_LAST 15 19 | 20 | #define UNIX64_FLAG_RET_IN_MEM (1 << 10) 21 | #define UNIX64_FLAG_XMM_ARGS (1 << 11) 22 | #define UNIX64_SIZE_SHIFT 12 23 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/_heapqmodule.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_heapqmodule.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/_math.h: -------------------------------------------------------------------------------- 1 | double _Py_acosh(double x); 2 | double _Py_asinh(double x); 3 | double _Py_atanh(double x); 4 | double _Py_expm1(double x); 5 | double _Py_log1p(double x); 6 | 7 | #ifdef HAVE_ACOSH 8 | #define m_acosh acosh 9 | #else 10 | /* if the system doesn't have acosh, use the substitute 11 | function defined in Modules/_math.c. */ 12 | #define m_acosh _Py_acosh 13 | #endif 14 | 15 | #ifdef HAVE_ASINH 16 | #define m_asinh asinh 17 | #else 18 | /* if the system doesn't have asinh, use the substitute 19 | function defined in Modules/_math.c. */ 20 | #define m_asinh _Py_asinh 21 | #endif 22 | 23 | #ifdef HAVE_ATANH 24 | #define m_atanh atanh 25 | #else 26 | /* if the system doesn't have atanh, use the substitute 27 | function defined in Modules/_math.c. */ 28 | #define m_atanh _Py_atanh 29 | #endif 30 | 31 | #ifdef HAVE_EXPM1 32 | #define m_expm1 expm1 33 | #else 34 | /* if the system doesn't have expm1, use the substitute 35 | function defined in Modules/_math.c. */ 36 | #define m_expm1 _Py_expm1 37 | #endif 38 | 39 | /* Use the substitute from _math.c on all platforms: 40 | it includes workarounds for buggy handling of zeros. */ 41 | #define m_log1p _Py_log1p 42 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/cache.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/cache.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/cache.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/cache.h -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/connection.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/connection.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/connection.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/connection.h -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/cursor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/cursor.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/cursor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/cursor.h -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/module.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/module.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/module.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/module.h -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/prepare_protocol.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/prepare_protocol.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/prepare_protocol.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/prepare_protocol.h -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/row.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/row.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/row.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/row.h -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/sqlitecompat.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/sqlitecompat.h -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/statement.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/statement.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/statement.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/statement.h -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/util.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/util.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/_sqlite/util.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/_sqlite/util.h -------------------------------------------------------------------------------- /bits-deps/python/Modules/ar_beos: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Truly fake ar, using a directory to store object files. 4 | # 5 | # Donn Cave, donn@oz.net 6 | 7 | usage='Usage: ar-fake cr libpython.dir obj.o ... 8 | ar-fake d libpython.dir obj.o ... 9 | ar-fake so libpython.dir libpython.so' 10 | 11 | case $# in 12 | 0|1|2) 13 | echo "$usage" >&2 14 | exit 1 15 | ;; 16 | esac 17 | 18 | command=$1 19 | library=$2 20 | shift 2 21 | 22 | case $command in 23 | cr) 24 | if test -d $library 25 | then : 26 | else 27 | mkdir $library 28 | fi 29 | if cp -p $* $library 30 | then 31 | # To force directory modify date, create or delete a file. 32 | if test -e $library/.tch 33 | then rm $library/.tch 34 | else echo tch > $library/.tch 35 | fi 36 | exit 0 37 | fi 38 | ;; 39 | d) 40 | if test -d $library 41 | then 42 | cd $library 43 | rm -f $* 44 | fi 45 | ;; 46 | so) 47 | case $BE_HOST_CPU in 48 | ppc) 49 | # In case your libpython.a refers to any exotic libraries, 50 | # mwld needs to know that here. The following hack makes 51 | # a couple of assumptions about Modules/Makefile. If it 52 | # doesn't work, you may as well add the necessary libraries 53 | # here explicitly instead. 54 | extralibs=$( 55 | (cd Modules; make -f Makefile -n link) | 56 | sed -n 's/.*\.so \(.*\) -o python.*/\1/p' 57 | ) 58 | mwld -xms -export pragma -nodup -o $1 $library/* $extralibs 59 | ;; 60 | x86) 61 | ld -shared -soname $(basename $1) -o $1 $library/* 62 | ;; 63 | esac 64 | status=$? 65 | cd $(dirname $1) 66 | ln -sf $PWD lib 67 | exit $status 68 | ;; 69 | *) 70 | echo "$usage" >&2 71 | exit 1 72 | ;; 73 | esac 74 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/cjkcodecs/alg_jisx0201.h: -------------------------------------------------------------------------------- 1 | #define JISX0201_R_ENCODE(c, assi) \ 2 | if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e) \ 3 | (assi) = (c); \ 4 | else if ((c) == 0x00a5) (assi) = 0x5c; \ 5 | else if ((c) == 0x203e) (assi) = 0x7e; 6 | #define JISX0201_K_ENCODE(c, assi) \ 7 | if ((c) >= 0xff61 && (c) <= 0xff9f) \ 8 | (assi) = (c) - 0xfec0; 9 | #define JISX0201_ENCODE(c, assi) \ 10 | JISX0201_R_ENCODE(c, assi) \ 11 | else JISX0201_K_ENCODE(c, assi) 12 | 13 | #define JISX0201_R_DECODE(c, assi) \ 14 | if ((c) < 0x5c) (assi) = (c); \ 15 | else if ((c) == 0x5c) (assi) = 0x00a5; \ 16 | else if ((c) < 0x7e) (assi) = (c); \ 17 | else if ((c) == 0x7e) (assi) = 0x203e; \ 18 | else if ((c) == 0x7f) (assi) = 0x7f; 19 | #define JISX0201_K_DECODE(c, assi) \ 20 | if ((c) >= 0xa1 && (c) <= 0xdf) \ 21 | (assi) = 0xfec0 + (c); 22 | #define JISX0201_DECODE(c, assi) \ 23 | JISX0201_R_DECODE(c, assi) \ 24 | else JISX0201_K_DECODE(c, assi) 25 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/config.c.in: -------------------------------------------------------------------------------- 1 | /* -*- C -*- *********************************************** 2 | Copyright (c) 2000, BeOpen.com. 3 | Copyright (c) 1995-2000, Corporation for National Research Initiatives. 4 | Copyright (c) 1990-1995, Stichting Mathematisch Centrum. 5 | All rights reserved. 6 | 7 | See the file "Misc/COPYRIGHT" for information on usage and 8 | redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 9 | ******************************************************************/ 10 | 11 | /* Module configuration */ 12 | 13 | /* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */ 14 | 15 | /* This file contains the table of built-in modules. 16 | See init_builtin() in import.c. */ 17 | 18 | #include "Python.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | 25 | /* -- ADDMODULE MARKER 1 -- */ 26 | 27 | extern void PyMarshal_Init(void); 28 | extern void initimp(void); 29 | extern void initgc(void); 30 | extern void init_ast(void); 31 | extern void _PyWarnings_Init(void); 32 | 33 | struct _inittab _PyImport_Inittab[] = { 34 | 35 | /* -- ADDMODULE MARKER 2 -- */ 36 | 37 | /* This module lives in marshal.c */ 38 | {"marshal", PyMarshal_Init}, 39 | 40 | /* This lives in import.c */ 41 | {"imp", initimp}, 42 | 43 | /* This lives in Python/Python-ast.c */ 44 | {"_ast", init_ast}, 45 | 46 | /* These entries are here for sys.builtin_module_names */ 47 | {"__main__", NULL}, 48 | {"__builtin__", NULL}, 49 | {"sys", NULL}, 50 | {"exceptions", NULL}, 51 | 52 | /* This lives in gcmodule.c */ 53 | {"gc", initgc}, 54 | 55 | /* This lives in _warnings.c */ 56 | {"_warnings", _PyWarnings_Init}, 57 | 58 | /* Sentinel */ 59 | {0, 0} 60 | }; 61 | 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/cryptmodule.c: -------------------------------------------------------------------------------- 1 | /* cryptmodule.c - by Steve Majewski 2 | */ 3 | 4 | #include "Python.h" 5 | 6 | #include 7 | 8 | #ifdef __VMS 9 | #include 10 | #endif 11 | 12 | /* Module crypt */ 13 | 14 | 15 | static PyObject *crypt_crypt(PyObject *self, PyObject *args) 16 | { 17 | char *word, *salt; 18 | #ifndef __VMS 19 | extern char * crypt(const char *, const char *); 20 | #endif 21 | 22 | if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) { 23 | return NULL; 24 | } 25 | /* On some platforms (AtheOS) crypt returns NULL for an invalid 26 | salt. Return None in that case. XXX Maybe raise an exception? */ 27 | return Py_BuildValue("s", crypt(word, salt)); 28 | 29 | } 30 | 31 | PyDoc_STRVAR(crypt_crypt__doc__, 32 | "crypt(word, salt) -> string\n\ 33 | word will usually be a user's password. salt is a 2-character string\n\ 34 | which will be used to select one of 4096 variations of DES. The characters\n\ 35 | in salt must be either \".\", \"/\", or an alphanumeric character. Returns\n\ 36 | the hashed password as a string, which will be composed of characters from\n\ 37 | the same alphabet as the salt."); 38 | 39 | 40 | static PyMethodDef crypt_methods[] = { 41 | {"crypt", crypt_crypt, METH_VARARGS, crypt_crypt__doc__}, 42 | {NULL, NULL} /* sentinel */ 43 | }; 44 | 45 | PyMODINIT_FUNC 46 | initcrypt(void) 47 | { 48 | Py_InitModule("crypt", crypt_methods); 49 | } 50 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/expat/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper 2 | Copyright (c) 2001-2017 Expat maintainers 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included 13 | in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/expat/expat_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Expat configuration for python. This file is not part of the expat 3 | * distribution. 4 | */ 5 | #ifndef EXPAT_CONFIG_H 6 | #define EXPAT_CONFIG_H 7 | 8 | #include 9 | #ifdef WORDS_BIGENDIAN 10 | #define BYTEORDER 4321 11 | #else 12 | #define BYTEORDER 1234 13 | #endif 14 | 15 | #define XML_NS 1 16 | #define XML_DTD 1 17 | #define XML_CONTEXT_BYTES 1024 18 | 19 | #endif /* EXPAT_CONFIG_H */ 20 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/getbuildinfo.c: -------------------------------------------------------------------------------- 1 | #include "Python.h" 2 | 3 | #ifndef DONT_HAVE_STDIO_H 4 | #include 5 | #endif 6 | 7 | #ifndef DATE 8 | #ifdef __DATE__ 9 | #define DATE __DATE__ 10 | #else 11 | #define DATE "xx/xx/xx" 12 | #endif 13 | #endif 14 | 15 | #ifndef TIME 16 | #ifdef __TIME__ 17 | #define TIME __TIME__ 18 | #else 19 | #define TIME "xx:xx:xx" 20 | #endif 21 | #endif 22 | 23 | /* XXX Only unix build process has been tested */ 24 | #ifndef GITVERSION 25 | #define GITVERSION "" 26 | #endif 27 | #ifndef GITTAG 28 | #define GITTAG "" 29 | #endif 30 | #ifndef GITBRANCH 31 | #define GITBRANCH "" 32 | #endif 33 | 34 | const char * 35 | Py_GetBuildInfo(void) 36 | { 37 | static char buildinfo[50 + sizeof(GITVERSION) + 38 | ((sizeof(GITTAG) > sizeof(GITBRANCH)) ? 39 | sizeof(GITTAG) : sizeof(GITBRANCH))]; 40 | const char *revision = _Py_gitversion(); 41 | const char *sep = *revision ? ":" : ""; 42 | const char *gitid = _Py_gitidentifier(); 43 | if (!(*gitid)) 44 | gitid = "default"; 45 | PyOS_snprintf(buildinfo, sizeof(buildinfo), 46 | "%s%s%s, %.20s, %.9s", gitid, sep, revision, 47 | DATE, TIME); 48 | return buildinfo; 49 | } 50 | 51 | const char * 52 | _Py_gitversion(void) 53 | { 54 | return GITVERSION; 55 | } 56 | 57 | const char * 58 | _Py_gitidentifier(void) 59 | { 60 | const char *gittag, *gitid; 61 | gittag = GITTAG; 62 | if ((*gittag) && strcmp(gittag, "undefined") != 0) 63 | gitid = gittag; 64 | else 65 | gitid = GITBRANCH; 66 | return gitid; 67 | } 68 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/ld_so_beos: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # linkmodule for Python 4 | # Chris Herborth (chrish@qnx.com) 5 | # 6 | # This is covered by the same copyright/licensing terms as the rest of 7 | # Python. 8 | # 9 | # Shell script to build shared library versions of the modules; since 10 | # the change to the *ahem* "proper" import/export mechanism, this script 11 | # is much simpler. It handles PowerPC and x86, too. 12 | # 13 | # This is called by the Modules/Makefile as $(LDSHARED): 14 | # 15 | # $(LDSHARED) foomodule.o -o foomodule$(SO) 16 | # 17 | # Could also be called as: 18 | # 19 | # $(LDSHARED) readline.o -L/boot/home/config/lib -lreadline -ltermcap \ 20 | # -o readline$(SO) 21 | # 22 | # so we need to preserve the arguments, sort of. 23 | 24 | # Make sure we got reasonable arguments. 25 | TARGET="" 26 | ARGS="" 27 | 28 | while [ "$#" != "0" ]; do 29 | case "$1" in 30 | -o) TARGET="$2"; shift; shift;; 31 | *) ARGS="$ARGS $1"; shift;; 32 | esac 33 | done 34 | 35 | if [ "$TARGET" = "" ] ; then 36 | echo "Usage:" 37 | echo 38 | echo " $0 [args] -o foomodule.so [args] foomodule.o [args]" 39 | echo 40 | echo "Where:" 41 | echo 42 | echo " [args] normal compiler arguments" 43 | exit 1 44 | fi 45 | 46 | # The shared libraries and glue objects we need to link against; these 47 | # libs are overkill for most of the standard modules, but it makes life 48 | # in this shell script easier. 49 | LIBS="-lbe -lnet -lroot" 50 | 51 | case $BE_HOST_CPU in 52 | ppc) 53 | # Boy, do we need a lot of crap... 54 | GLUE_LOC=/boot/develop/lib/ppc 55 | GLUE="${GLUE_LOC}/glue-noinit.a ${GLUE_LOC}/init_term_dyn.o" 56 | case $(uname -r) in 57 | 4.0*) CC="mwcc -xms -export pragma -nodup" ;; 58 | *) CC="mwcc -shared -export pragma -nodup" ;; 59 | esac 60 | ;; 61 | 62 | x86) 63 | # We don't need as much crap here... 64 | GLUE="" 65 | CC="gcc -nostart -Wl,-soname=${TARGET}" 66 | ;; 67 | 68 | *) 69 | # What the?!? 70 | echo "$0 doesn't support $BE_HOST_CPU systems..." 71 | echo "You're on your own... I'd be surprised if this works." 72 | GLUE="" 73 | CC="cc" 74 | ;; 75 | esac 76 | 77 | # Now link that shared lib... 78 | $CC -o $TARGET $ARGS $GLUE $LIBS 79 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/posixmodule.h: -------------------------------------------------------------------------------- 1 | /* Declarations shared between the different POSIX-related modules */ 2 | 3 | #ifndef Py_POSIXMODULE_H 4 | #define Py_POSIXMODULE_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef HAVE_SYS_TYPES_H 10 | #include 11 | #endif 12 | 13 | #ifndef MS_WINDOWS 14 | PyAPI_FUNC(PyObject *) _PyInt_FromUid(uid_t); 15 | PyAPI_FUNC(PyObject *) _PyInt_FromGid(gid_t); 16 | PyAPI_FUNC(int) _Py_Uid_Converter(PyObject *, void *); 17 | PyAPI_FUNC(int) _Py_Gid_Converter(PyObject *, void *); 18 | #endif /* MS_WINDOWS */ 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | #endif /* !Py_POSIXMODULE_H */ 24 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/python.c: -------------------------------------------------------------------------------- 1 | /* Minimal main program -- everything is loaded from the library */ 2 | 3 | #include "Python.h" 4 | 5 | #ifdef __FreeBSD__ 6 | #include 7 | #endif 8 | 9 | int 10 | main(int argc, char **argv) 11 | { 12 | /* 754 requires that FP exceptions run in "no stop" mode by default, 13 | * and until C vendors implement C99's ways to control FP exceptions, 14 | * Python requires non-stop mode. Alas, some platforms enable FP 15 | * exceptions by default. Here we disable them. 16 | */ 17 | #ifdef __FreeBSD__ 18 | fedisableexcept(FE_OVERFLOW); 19 | #endif 20 | return Py_Main(argc, argv); 21 | } 22 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/rotatingtree.h: -------------------------------------------------------------------------------- 1 | /* "Rotating trees" (Armin Rigo) 2 | * 3 | * Google "splay trees" for the general idea. 4 | * 5 | * It's a dict-like data structure that works best when accesses are not 6 | * random, but follow a strong pattern. The one implemented here is for 7 | * access patterns where the same small set of keys is looked up over 8 | * and over again, and this set of keys evolves slowly over time. 9 | */ 10 | 11 | #include 12 | 13 | #define EMPTY_ROTATING_TREE ((rotating_node_t *)NULL) 14 | 15 | typedef struct rotating_node_s rotating_node_t; 16 | typedef int (*rotating_tree_enum_fn) (rotating_node_t *node, void *arg); 17 | 18 | struct rotating_node_s { 19 | void *key; 20 | rotating_node_t *left; 21 | rotating_node_t *right; 22 | }; 23 | 24 | void RotatingTree_Add(rotating_node_t **root, rotating_node_t *node); 25 | rotating_node_t* RotatingTree_Get(rotating_node_t **root, void *key); 26 | int RotatingTree_Enum(rotating_node_t *root, rotating_tree_enum_fn enumfn, 27 | void *arg); 28 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/sgimodule.c: -------------------------------------------------------------------------------- 1 | 2 | /* SGI module -- random SGI-specific things */ 3 | 4 | #include "Python.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | static PyObject * 11 | sgi_nap(PyObject *self, PyObject *args) 12 | { 13 | long ticks; 14 | if (!PyArg_ParseTuple(args, "l:nap", &ticks)) 15 | return NULL; 16 | Py_BEGIN_ALLOW_THREADS 17 | sginap(ticks); 18 | Py_END_ALLOW_THREADS 19 | Py_INCREF(Py_None); 20 | return Py_None; 21 | } 22 | 23 | extern char *_getpty(int *, int, mode_t, int); 24 | 25 | static PyObject * 26 | sgi__getpty(PyObject *self, PyObject *args) 27 | { 28 | int oflag; 29 | int mode; 30 | int nofork; 31 | char *name; 32 | int fildes; 33 | if (!PyArg_ParseTuple(args, "iii:_getpty", &oflag, &mode, &nofork)) 34 | return NULL; 35 | errno = 0; 36 | name = _getpty(&fildes, oflag, (mode_t)mode, nofork); 37 | if (name == NULL) { 38 | PyErr_SetFromErrno(PyExc_IOError); 39 | return NULL; 40 | } 41 | return Py_BuildValue("(si)", name, fildes); 42 | } 43 | 44 | static PyMethodDef sgi_methods[] = { 45 | {"nap", sgi_nap, METH_VARARGS}, 46 | {"_getpty", sgi__getpty, METH_VARARGS}, 47 | {NULL, NULL} /* sentinel */ 48 | }; 49 | 50 | 51 | void 52 | initsgi(void) 53 | { 54 | Py_InitModule("sgi", sgi_methods); 55 | } 56 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/timingmodule.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: George V. Neville-Neil 3 | */ 4 | 5 | #include "Python.h" 6 | 7 | /* Our stuff... */ 8 | #include "timing.h" 9 | 10 | static PyObject * 11 | start_timing(PyObject *self) 12 | { 13 | Py_INCREF(Py_None); 14 | BEGINTIMING; 15 | return Py_None; 16 | } 17 | 18 | static PyObject * 19 | finish_timing(PyObject *self) 20 | { 21 | ENDTIMING 22 | Py_INCREF(Py_None); 23 | return Py_None; 24 | } 25 | 26 | static PyObject * 27 | seconds(PyObject *self) 28 | { 29 | return PyInt_FromLong(TIMINGS); 30 | } 31 | 32 | static PyObject * 33 | milli(PyObject *self) 34 | { 35 | return PyInt_FromLong(TIMINGMS); 36 | } 37 | 38 | static PyObject * 39 | micro(PyObject *self) 40 | { 41 | return PyInt_FromLong(TIMINGUS); 42 | } 43 | 44 | 45 | static PyMethodDef timing_methods[] = { 46 | {"start", (PyCFunction)start_timing, METH_NOARGS}, 47 | {"finish", (PyCFunction)finish_timing, METH_NOARGS}, 48 | {"seconds", (PyCFunction)seconds, METH_NOARGS}, 49 | {"milli", (PyCFunction)milli, METH_NOARGS}, 50 | {"micro", (PyCFunction)micro, METH_NOARGS}, 51 | {NULL, NULL} 52 | }; 53 | 54 | 55 | PyMODINIT_FUNC inittiming(void) 56 | { 57 | if (PyErr_WarnPy3k("the timing module has been removed in " 58 | "Python 3.0; use time.clock() instead", 2) < 0) 59 | return; 60 | 61 | (void)Py_InitModule("timing", timing_methods); 62 | } 63 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/tkinter.h: -------------------------------------------------------------------------------- 1 | #ifndef TKINTER_H 2 | #define TKINTER_H 3 | 4 | /* This header is used to share some macros between _tkinter.c and 5 | * tkappinit.c. 6 | * Be sure to include tk.h before including this header so 7 | * TK_HEX_VERSION is properly defined. */ 8 | 9 | /* TK_RELEASE_LEVEL is always one of the following: 10 | * TCL_ALPHA_RELEASE 0 11 | * TCL_BETA_RELEASE 1 12 | * TCL_FINAL_RELEASE 2 13 | */ 14 | #define TK_HEX_VERSION ((TK_MAJOR_VERSION << 24) | \ 15 | (TK_MINOR_VERSION << 16) | \ 16 | (TK_RELEASE_LEVEL << 8) | \ 17 | (TK_RELEASE_SERIAL << 0)) 18 | 19 | /* TK_VERSION_HEX packs fields in wrong order, not suitable for comparing of 20 | * non-final releases. Left for backward compatibility. 21 | */ 22 | #define TK_VERSION_HEX ((TK_MAJOR_VERSION << 24) | \ 23 | (TK_MINOR_VERSION << 16) | \ 24 | (TK_RELEASE_SERIAL << 8) | \ 25 | (TK_RELEASE_LEVEL << 0)) 26 | 27 | /* Protect Tk 8.4.13 and older from a deadlock that happens when trying 28 | * to load tk after a failed attempt. */ 29 | #if TK_HEX_VERSION < 0x0804020e 30 | #define TKINTER_PROTECT_LOADTK 31 | #define TKINTER_LOADTK_ERRMSG \ 32 | "Calling Tk_Init again after a previous call failed might deadlock" 33 | #endif 34 | 35 | #endif /* !TKINTER_H */ 36 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/unicodedata.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Modules/unicodedata.c -------------------------------------------------------------------------------- /bits-deps/python/Modules/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/zlib/zlib.map: -------------------------------------------------------------------------------- 1 | ZLIB_1.2.0 { 2 | global: 3 | compressBound; 4 | deflateBound; 5 | inflateBack; 6 | inflateBackEnd; 7 | inflateBackInit_; 8 | inflateCopy; 9 | local: 10 | deflate_copyright; 11 | inflate_copyright; 12 | inflate_fast; 13 | inflate_table; 14 | zcalloc; 15 | zcfree; 16 | z_errmsg; 17 | gz_error; 18 | gz_intmax; 19 | _*; 20 | }; 21 | 22 | ZLIB_1.2.0.2 { 23 | gzclearerr; 24 | gzungetc; 25 | zlibCompileFlags; 26 | } ZLIB_1.2.0; 27 | 28 | ZLIB_1.2.0.8 { 29 | deflatePrime; 30 | } ZLIB_1.2.0.2; 31 | 32 | ZLIB_1.2.2 { 33 | adler32_combine; 34 | crc32_combine; 35 | deflateSetHeader; 36 | inflateGetHeader; 37 | } ZLIB_1.2.0.8; 38 | 39 | ZLIB_1.2.2.3 { 40 | deflateTune; 41 | gzdirect; 42 | } ZLIB_1.2.2; 43 | 44 | ZLIB_1.2.2.4 { 45 | inflatePrime; 46 | } ZLIB_1.2.2.3; 47 | 48 | ZLIB_1.2.3.3 { 49 | adler32_combine64; 50 | crc32_combine64; 51 | gzopen64; 52 | gzseek64; 53 | gztell64; 54 | inflateUndermine; 55 | } ZLIB_1.2.2.4; 56 | 57 | ZLIB_1.2.3.4 { 58 | inflateReset2; 59 | inflateMark; 60 | } ZLIB_1.2.3.3; 61 | 62 | ZLIB_1.2.3.5 { 63 | gzbuffer; 64 | gzoffset; 65 | gzoffset64; 66 | gzclose_r; 67 | gzclose_w; 68 | } ZLIB_1.2.3.4; 69 | 70 | ZLIB_1.2.5.1 { 71 | deflatePending; 72 | } ZLIB_1.2.3.5; 73 | 74 | ZLIB_1.2.5.2 { 75 | deflateResetKeep; 76 | gzgetc_; 77 | inflateResetKeep; 78 | } ZLIB_1.2.5.1; 79 | 80 | ZLIB_1.2.7.1 { 81 | inflateGetDictionary; 82 | gzvprintf; 83 | } ZLIB_1.2.5.2; 84 | 85 | ZLIB_1.2.9 { 86 | inflateCodesUsed; 87 | inflateValidate; 88 | uncompress2; 89 | gzfread; 90 | gzfwrite; 91 | deflateGetDictionary; 92 | adler32_z; 93 | crc32_z; 94 | } ZLIB_1.2.7.1; 95 | -------------------------------------------------------------------------------- /bits-deps/python/Modules/zlib/zlib.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | sharedlibdir=@sharedlibdir@ 5 | includedir=@includedir@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /bits-deps/python/Objects/listsort.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits-deps/python/Objects/listsort.txt -------------------------------------------------------------------------------- /bits-deps/python/Objects/stringlib/README.txt: -------------------------------------------------------------------------------- 1 | bits shared by the stringobject and unicodeobject implementations (and 2 | possibly other modules, in a not too distant future). 3 | 4 | the stuff in here is included into relevant places; see the individual 5 | source files for details. 6 | 7 | -------------------------------------------------------------------- 8 | the following defines used by the different modules: 9 | 10 | STRINGLIB_CHAR 11 | 12 | the type used to hold a character (char or Py_UNICODE) 13 | 14 | STRINGLIB_EMPTY 15 | 16 | a PyObject representing the empty string, only to be used if 17 | STRINGLIB_MUTABLE is 0 18 | 19 | Py_ssize_t STRINGLIB_LEN(PyObject*) 20 | 21 | returns the length of the given string object (which must be of the 22 | right type) 23 | 24 | PyObject* STRINGLIB_NEW(STRINGLIB_CHAR*, Py_ssize_t) 25 | 26 | creates a new string object 27 | 28 | STRINGLIB_CHAR* STRINGLIB_STR(PyObject*) 29 | 30 | returns the pointer to the character data for the given string 31 | object (which must be of the right type) 32 | 33 | int STRINGLIB_CHECK_EXACT(PyObject *) 34 | 35 | returns true if the object is an instance of our type, not a subclass 36 | 37 | STRINGLIB_MUTABLE 38 | 39 | must be 0 or 1 to tell the cpp macros in stringlib code if the object 40 | being operated on is mutable or not 41 | -------------------------------------------------------------------------------- /bits-deps/python/Objects/stringlib/count.h: -------------------------------------------------------------------------------- 1 | /* stringlib: count implementation */ 2 | 3 | #ifndef STRINGLIB_COUNT_H 4 | #define STRINGLIB_COUNT_H 5 | 6 | #ifndef STRINGLIB_FASTSEARCH_H 7 | #error must include "stringlib/fastsearch.h" before including this module 8 | #endif 9 | 10 | Py_LOCAL_INLINE(Py_ssize_t) 11 | stringlib_count(const STRINGLIB_CHAR* str, Py_ssize_t str_len, 12 | const STRINGLIB_CHAR* sub, Py_ssize_t sub_len, 13 | Py_ssize_t maxcount) 14 | { 15 | Py_ssize_t count; 16 | 17 | if (str_len < 0) 18 | return 0; /* start > len(str) */ 19 | if (sub_len == 0) 20 | return (str_len < maxcount) ? str_len + 1 : maxcount; 21 | 22 | count = fastsearch(str, str_len, sub, sub_len, maxcount, FAST_COUNT); 23 | 24 | if (count < 0) 25 | return 0; /* no match */ 26 | 27 | return count; 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /bits-deps/python/Objects/stringlib/stringdefs.h: -------------------------------------------------------------------------------- 1 | #ifndef STRINGLIB_STRINGDEFS_H 2 | #define STRINGLIB_STRINGDEFS_H 3 | 4 | /* this is sort of a hack. there's at least one place (formatting 5 | floats) where some stringlib code takes a different path if it's 6 | compiled as unicode. */ 7 | #define STRINGLIB_IS_UNICODE 0 8 | 9 | #define STRINGLIB_OBJECT PyStringObject 10 | #define STRINGLIB_CHAR char 11 | #define STRINGLIB_TYPE_NAME "string" 12 | #define STRINGLIB_PARSE_CODE "S" 13 | #define STRINGLIB_EMPTY nullstring 14 | #define STRINGLIB_ISSPACE Py_ISSPACE 15 | #define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r')) 16 | #define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9')) 17 | #define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1) 18 | #define STRINGLIB_TOUPPER Py_TOUPPER 19 | #define STRINGLIB_TOLOWER Py_TOLOWER 20 | #define STRINGLIB_FILL memset 21 | #define STRINGLIB_STR PyString_AS_STRING 22 | #define STRINGLIB_LEN PyString_GET_SIZE 23 | #define STRINGLIB_NEW PyString_FromStringAndSize 24 | #define STRINGLIB_RESIZE _PyString_Resize 25 | #define STRINGLIB_CHECK PyString_Check 26 | #define STRINGLIB_CHECK_EXACT PyString_CheckExact 27 | #define STRINGLIB_TOSTR PyObject_Str 28 | #define STRINGLIB_GROUPING _PyString_InsertThousandsGrouping 29 | #define STRINGLIB_GROUPING_LOCALE _PyString_InsertThousandsGroupingLocale 30 | 31 | #define STRINGLIB_WANT_CONTAINS_OBJ 1 32 | 33 | #endif /* !STRINGLIB_STRINGDEFS_H */ 34 | -------------------------------------------------------------------------------- /bits-deps/python/Objects/stringlib/unicodedefs.h: -------------------------------------------------------------------------------- 1 | #ifndef STRINGLIB_UNICODEDEFS_H 2 | #define STRINGLIB_UNICODEDEFS_H 3 | 4 | /* this is sort of a hack. there's at least one place (formatting 5 | floats) where some stringlib code takes a different path if it's 6 | compiled as unicode. */ 7 | #define STRINGLIB_IS_UNICODE 1 8 | 9 | #define STRINGLIB_OBJECT PyUnicodeObject 10 | #define STRINGLIB_CHAR Py_UNICODE 11 | #define STRINGLIB_TYPE_NAME "unicode" 12 | #define STRINGLIB_PARSE_CODE "U" 13 | #define STRINGLIB_EMPTY unicode_empty 14 | #define STRINGLIB_ISSPACE Py_UNICODE_ISSPACE 15 | #define STRINGLIB_ISLINEBREAK BLOOM_LINEBREAK 16 | #define STRINGLIB_ISDECIMAL Py_UNICODE_ISDECIMAL 17 | #define STRINGLIB_TODECIMAL Py_UNICODE_TODECIMAL 18 | #define STRINGLIB_TOUPPER Py_UNICODE_TOUPPER 19 | #define STRINGLIB_TOLOWER Py_UNICODE_TOLOWER 20 | #define STRINGLIB_FILL Py_UNICODE_FILL 21 | #define STRINGLIB_STR PyUnicode_AS_UNICODE 22 | #define STRINGLIB_LEN PyUnicode_GET_SIZE 23 | #define STRINGLIB_NEW PyUnicode_FromUnicode 24 | #define STRINGLIB_RESIZE PyUnicode_Resize 25 | #define STRINGLIB_CHECK PyUnicode_Check 26 | #define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact 27 | #define STRINGLIB_GROUPING _PyUnicode_InsertThousandsGrouping 28 | 29 | #if PY_VERSION_HEX < 0x03000000 30 | #define STRINGLIB_TOSTR PyObject_Unicode 31 | #else 32 | #define STRINGLIB_TOSTR PyObject_Str 33 | #endif 34 | 35 | #define STRINGLIB_WANT_CONTAINS_OBJ 1 36 | 37 | #endif /* !STRINGLIB_UNICODEDEFS_H */ 38 | -------------------------------------------------------------------------------- /bits-deps/python/Parser/bitset.c: -------------------------------------------------------------------------------- 1 | 2 | /* Bitset primitives used by the parser generator */ 3 | 4 | #include "pgenheaders.h" 5 | #include "bitset.h" 6 | 7 | bitset 8 | newbitset(int nbits) 9 | { 10 | int nbytes = NBYTES(nbits); 11 | bitset ss = (char *)PyObject_MALLOC(sizeof(BYTE) * nbytes); 12 | 13 | if (ss == NULL) 14 | Py_FatalError("no mem for bitset"); 15 | 16 | ss += nbytes; 17 | while (--nbytes >= 0) 18 | *--ss = 0; 19 | return ss; 20 | } 21 | 22 | void 23 | delbitset(bitset ss) 24 | { 25 | PyObject_FREE(ss); 26 | } 27 | 28 | int 29 | addbit(bitset ss, int ibit) 30 | { 31 | int ibyte = BIT2BYTE(ibit); 32 | BYTE mask = BIT2MASK(ibit); 33 | 34 | if (ss[ibyte] & mask) 35 | return 0; /* Bit already set */ 36 | ss[ibyte] |= mask; 37 | return 1; 38 | } 39 | 40 | #if 0 /* Now a macro */ 41 | int 42 | testbit(bitset ss, int ibit) 43 | { 44 | return (ss[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0; 45 | } 46 | #endif 47 | 48 | int 49 | samebitset(bitset ss1, bitset ss2, int nbits) 50 | { 51 | int i; 52 | 53 | for (i = NBYTES(nbits); --i >= 0; ) 54 | if (*ss1++ != *ss2++) 55 | return 0; 56 | return 1; 57 | } 58 | 59 | void 60 | mergebitset(bitset ss1, bitset ss2, int nbits) 61 | { 62 | int i; 63 | 64 | for (i = NBYTES(nbits); --i >= 0; ) 65 | *ss1++ |= *ss2++; 66 | } 67 | -------------------------------------------------------------------------------- /bits-deps/python/Parser/grammar1.c: -------------------------------------------------------------------------------- 1 | 2 | /* Grammar subroutines needed by parser */ 3 | 4 | #include "Python.h" 5 | #include "pgenheaders.h" 6 | #include "grammar.h" 7 | #include "token.h" 8 | 9 | /* Return the DFA for the given type */ 10 | 11 | dfa * 12 | PyGrammar_FindDFA(grammar *g, register int type) 13 | { 14 | register dfa *d; 15 | #if 1 16 | /* Massive speed-up */ 17 | d = &g->g_dfa[type - NT_OFFSET]; 18 | assert(d->d_type == type); 19 | return d; 20 | #else 21 | /* Old, slow version */ 22 | register int i; 23 | 24 | for (i = g->g_ndfas, d = g->g_dfa; --i >= 0; d++) { 25 | if (d->d_type == type) 26 | return d; 27 | } 28 | assert(0); 29 | /* NOTREACHED */ 30 | #endif 31 | } 32 | 33 | char * 34 | PyGrammar_LabelRepr(label *lb) 35 | { 36 | static char buf[100]; 37 | 38 | if (lb->lb_type == ENDMARKER) 39 | return "EMPTY"; 40 | else if (ISNONTERMINAL(lb->lb_type)) { 41 | if (lb->lb_str == NULL) { 42 | PyOS_snprintf(buf, sizeof(buf), "NT%d", lb->lb_type); 43 | return buf; 44 | } 45 | else 46 | return lb->lb_str; 47 | } 48 | else { 49 | if (lb->lb_str == NULL) 50 | return _PyParser_TokenNames[lb->lb_type]; 51 | else { 52 | PyOS_snprintf(buf, sizeof(buf), "%.32s(%.32s)", 53 | _PyParser_TokenNames[lb->lb_type], lb->lb_str); 54 | return buf; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /bits-deps/python/Parser/listnode.c: -------------------------------------------------------------------------------- 1 | 2 | /* List a node on a file */ 3 | 4 | #include "pgenheaders.h" 5 | #include "token.h" 6 | #include "node.h" 7 | 8 | /* Forward */ 9 | static void list1node(FILE *, node *); 10 | static void listnode(FILE *, node *); 11 | 12 | void 13 | PyNode_ListTree(node *n) 14 | { 15 | listnode(stdout, n); 16 | } 17 | 18 | static int level, atbol; 19 | 20 | static void 21 | listnode(FILE *fp, node *n) 22 | { 23 | level = 0; 24 | atbol = 1; 25 | list1node(fp, n); 26 | } 27 | 28 | static void 29 | list1node(FILE *fp, node *n) 30 | { 31 | if (n == 0) 32 | return; 33 | if (ISNONTERMINAL(TYPE(n))) { 34 | int i; 35 | for (i = 0; i < NCH(n); i++) 36 | list1node(fp, CHILD(n, i)); 37 | } 38 | else if (ISTERMINAL(TYPE(n))) { 39 | switch (TYPE(n)) { 40 | case INDENT: 41 | ++level; 42 | break; 43 | case DEDENT: 44 | --level; 45 | break; 46 | default: 47 | if (atbol) { 48 | int i; 49 | for (i = 0; i < level; ++i) 50 | fprintf(fp, "\t"); 51 | atbol = 0; 52 | } 53 | if (TYPE(n) == NEWLINE) { 54 | if (STR(n) != NULL) 55 | fprintf(fp, "%s", STR(n)); 56 | fprintf(fp, "\n"); 57 | atbol = 1; 58 | } 59 | else 60 | fprintf(fp, "%s ", STR(n)); 61 | break; 62 | } 63 | } 64 | else 65 | fprintf(fp, "? "); 66 | } 67 | -------------------------------------------------------------------------------- /bits-deps/python/Parser/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_PARSER_H 2 | #define Py_PARSER_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Parser interface */ 9 | 10 | #define MAXSTACK 1500 11 | 12 | typedef struct { 13 | int s_state; /* State in current DFA */ 14 | dfa *s_dfa; /* Current DFA */ 15 | struct _node *s_parent; /* Where to add next node */ 16 | } stackentry; 17 | 18 | typedef struct { 19 | stackentry *s_top; /* Top entry */ 20 | stackentry s_base[MAXSTACK];/* Array of stack entries */ 21 | /* NB The stack grows down */ 22 | } stack; 23 | 24 | typedef struct { 25 | stack p_stack; /* Stack of parser states */ 26 | grammar *p_grammar; /* Grammar to use */ 27 | node *p_tree; /* Top of parse tree */ 28 | #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD 29 | unsigned long p_flags; /* see co_flags in Include/code.h */ 30 | #endif 31 | } parser_state; 32 | 33 | parser_state *PyParser_New(grammar *g, int start); 34 | void PyParser_Delete(parser_state *ps); 35 | int PyParser_AddToken(parser_state *ps, int type, char *str, int lineno, int col_offset, 36 | int *expected_ret); 37 | void PyGrammar_AddAccelerators(grammar *g); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | #endif /* !Py_PARSER_H */ 43 | -------------------------------------------------------------------------------- /bits-deps/python/Parser/tokenizer_pgen.c: -------------------------------------------------------------------------------- 1 | #define PGEN 2 | #include "tokenizer.c" 3 | -------------------------------------------------------------------------------- /bits-deps/python/Python/asdl.c: -------------------------------------------------------------------------------- 1 | #include "Python.h" 2 | #include "asdl.h" 3 | 4 | asdl_seq * 5 | asdl_seq_new(int size, PyArena *arena) 6 | { 7 | asdl_seq *seq = NULL; 8 | size_t n = (size ? (sizeof(void *) * (size - 1)) : 0); 9 | 10 | /* check size is sane */ 11 | if (size < 0 || size == INT_MIN || 12 | (size && ((size - 1) > (PY_SIZE_MAX / sizeof(void *))))) { 13 | PyErr_NoMemory(); 14 | return NULL; 15 | } 16 | 17 | /* check if size can be added safely */ 18 | if (n > PY_SIZE_MAX - sizeof(asdl_seq)) { 19 | PyErr_NoMemory(); 20 | return NULL; 21 | } 22 | 23 | n += sizeof(asdl_seq); 24 | 25 | seq = (asdl_seq *)PyArena_Malloc(arena, n); 26 | if (!seq) { 27 | PyErr_NoMemory(); 28 | return NULL; 29 | } 30 | memset(seq, 0, n); 31 | seq->size = size; 32 | return seq; 33 | } 34 | 35 | asdl_int_seq * 36 | asdl_int_seq_new(int size, PyArena *arena) 37 | { 38 | asdl_int_seq *seq = NULL; 39 | size_t n = (size ? (sizeof(void *) * (size - 1)) : 0); 40 | 41 | /* check size is sane */ 42 | if (size < 0 || size == INT_MIN || 43 | (size && ((size - 1) > (PY_SIZE_MAX / sizeof(void *))))) { 44 | PyErr_NoMemory(); 45 | return NULL; 46 | } 47 | 48 | /* check if size can be added safely */ 49 | if (n > PY_SIZE_MAX - sizeof(asdl_seq)) { 50 | PyErr_NoMemory(); 51 | return NULL; 52 | } 53 | 54 | n += sizeof(asdl_seq); 55 | 56 | seq = (asdl_int_seq *)PyArena_Malloc(arena, n); 57 | if (!seq) { 58 | PyErr_NoMemory(); 59 | return NULL; 60 | } 61 | memset(seq, 0, n); 62 | seq->size = size; 63 | return seq; 64 | } 65 | -------------------------------------------------------------------------------- /bits-deps/python/Python/atof.c: -------------------------------------------------------------------------------- 1 | 2 | /* Just in case you haven't got an atof() around... 3 | This one doesn't check for bad syntax or overflow, 4 | and is slow and inaccurate. 5 | But it's good enough for the occasional string literal... */ 6 | 7 | #include "pyconfig.h" 8 | 9 | #include 10 | 11 | double atof(char *s) 12 | { 13 | double a = 0.0; 14 | int e = 0; 15 | int c; 16 | while ((c = *s++) != '\0' && isdigit(c)) { 17 | a = a*10.0 + (c - '0'); 18 | } 19 | if (c == '.') { 20 | while ((c = *s++) != '\0' && isdigit(c)) { 21 | a = a*10.0 + (c - '0'); 22 | e = e-1; 23 | } 24 | } 25 | if (c == 'e' || c == 'E') { 26 | int sign = 1; 27 | int i = 0; 28 | c = *s++; 29 | if (c == '+') 30 | c = *s++; 31 | else if (c == '-') { 32 | c = *s++; 33 | sign = -1; 34 | } 35 | while (isdigit(c)) { 36 | i = i*10 + (c - '0'); 37 | c = *s++; 38 | } 39 | e += i*sign; 40 | } 41 | while (e > 0) { 42 | a *= 10.0; 43 | e--; 44 | } 45 | while (e < 0) { 46 | a *= 0.1; 47 | e++; 48 | } 49 | return a; 50 | } 51 | -------------------------------------------------------------------------------- /bits-deps/python/Python/dup2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Public domain dup2() lookalike 3 | * by Curtis Jackson @ AT&T Technologies, Burlington, NC 4 | * electronic address: burl!rcj 5 | * 6 | * dup2 performs the following functions: 7 | * 8 | * Check to make sure that fd1 is a valid open file descriptor. 9 | * Check to see if fd2 is already open; if so, close it. 10 | * Duplicate fd1 onto fd2; checking to make sure fd2 is a valid fd. 11 | * Return fd2 if all went well; return BADEXIT otherwise. 12 | */ 13 | 14 | #include 15 | #include 16 | 17 | #define BADEXIT -1 18 | 19 | int 20 | dup2(int fd1, int fd2) 21 | { 22 | if (fd1 != fd2) { 23 | if (fcntl(fd1, F_GETFL) < 0) 24 | return BADEXIT; 25 | if (fcntl(fd2, F_GETFL) >= 0) 26 | close(fd2); 27 | if (fcntl(fd1, F_DUPFD, fd2) < 0) 28 | return BADEXIT; 29 | } 30 | return fd2; 31 | } 32 | -------------------------------------------------------------------------------- /bits-deps/python/Python/dynload_atheos.c: -------------------------------------------------------------------------------- 1 | 2 | /* Support for dynamic loading of extension modules */ 3 | 4 | #include 5 | #include 6 | 7 | #include "Python.h" 8 | #include "importdl.h" 9 | 10 | 11 | const struct filedescr _PyImport_DynLoadFiletab[] = { 12 | {".so", "rb", C_EXTENSION}, 13 | {"module.so", "rb", C_EXTENSION}, 14 | {0, 0} 15 | }; 16 | 17 | dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, 18 | const char *pathname, FILE *fp) 19 | { 20 | void *p; 21 | int lib; 22 | char funcname[258]; 23 | 24 | if (Py_VerboseFlag) 25 | printf("load_library %s\n", pathname); 26 | 27 | lib = load_library(pathname, 0); 28 | if (lib < 0) { 29 | char buf[512]; 30 | if (Py_VerboseFlag) 31 | perror(pathname); 32 | PyOS_snprintf(buf, sizeof(buf), "Failed to load %.200s: %.200s", 33 | pathname, strerror(errno)); 34 | PyErr_SetString(PyExc_ImportError, buf); 35 | return NULL; 36 | } 37 | PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname); 38 | if (Py_VerboseFlag) 39 | printf("get_symbol_address %s\n", funcname); 40 | if (get_symbol_address(lib, funcname, -1, &p) < 0) { 41 | p = NULL; 42 | if (Py_VerboseFlag) 43 | perror(funcname); 44 | } 45 | 46 | return (dl_funcptr) p; 47 | } 48 | -------------------------------------------------------------------------------- /bits-deps/python/Python/dynload_dl.c: -------------------------------------------------------------------------------- 1 | 2 | /* Support for dynamic loading of extension modules */ 3 | 4 | #include "dl.h" 5 | 6 | #include "Python.h" 7 | #include "importdl.h" 8 | 9 | 10 | extern char *Py_GetProgramName(void); 11 | 12 | const struct filedescr _PyImport_DynLoadFiletab[] = { 13 | {".o", "rb", C_EXTENSION}, 14 | {"module.o", "rb", C_EXTENSION}, 15 | {0, 0} 16 | }; 17 | 18 | 19 | dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, 20 | const char *pathname, FILE *fp) 21 | { 22 | char funcname[258]; 23 | 24 | PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname); 25 | return dl_loadmod(Py_GetProgramName(), pathname, funcname); 26 | } 27 | -------------------------------------------------------------------------------- /bits-deps/python/Python/dynload_hpux.c: -------------------------------------------------------------------------------- 1 | 2 | /* Support for dynamic loading of extension modules */ 3 | 4 | #include "dl.h" 5 | #include 6 | 7 | #include "Python.h" 8 | #include "importdl.h" 9 | 10 | #if defined(__hp9000s300) 11 | #define FUNCNAME_PATTERN "_init%.200s" 12 | #else 13 | #define FUNCNAME_PATTERN "init%.200s" 14 | #endif 15 | 16 | const struct filedescr _PyImport_DynLoadFiletab[] = { 17 | {SHLIB_EXT, "rb", C_EXTENSION}, 18 | {"module"SHLIB_EXT, "rb", C_EXTENSION}, 19 | {0, 0} 20 | }; 21 | 22 | dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, 23 | const char *pathname, FILE *fp) 24 | { 25 | dl_funcptr p; 26 | shl_t lib; 27 | int flags; 28 | char funcname[258]; 29 | 30 | flags = BIND_FIRST | BIND_DEFERRED; 31 | if (Py_VerboseFlag) { 32 | flags = BIND_FIRST | BIND_IMMEDIATE | 33 | BIND_NONFATAL | BIND_VERBOSE; 34 | printf("shl_load %s\n",pathname); 35 | } 36 | lib = shl_load(pathname, flags, 0); 37 | /* XXX Chuck Blake once wrote that 0 should be BIND_NOSTART? */ 38 | if (lib == NULL) { 39 | char buf[256]; 40 | if (Py_VerboseFlag) 41 | perror(pathname); 42 | PyOS_snprintf(buf, sizeof(buf), "Failed to load %.200s", 43 | pathname); 44 | PyErr_SetString(PyExc_ImportError, buf); 45 | return NULL; 46 | } 47 | PyOS_snprintf(funcname, sizeof(funcname), FUNCNAME_PATTERN, shortname); 48 | if (Py_VerboseFlag) 49 | printf("shl_findsym %s\n", funcname); 50 | if (shl_findsym(&lib, funcname, TYPE_UNDEFINED, (void *) &p) == -1) { 51 | shl_unload(lib); 52 | p = NULL; 53 | } 54 | if (p == NULL && Py_VerboseFlag) 55 | perror(funcname); 56 | 57 | return p; 58 | } 59 | -------------------------------------------------------------------------------- /bits-deps/python/Python/dynload_os2.c: -------------------------------------------------------------------------------- 1 | 2 | /* Support for dynamic loading of extension modules */ 3 | 4 | #define INCL_DOSERRORS 5 | #define INCL_DOSMODULEMGR 6 | #include 7 | 8 | #include "Python.h" 9 | #include "importdl.h" 10 | 11 | 12 | const struct filedescr _PyImport_DynLoadFiletab[] = { 13 | {".pyd", "rb", C_EXTENSION}, 14 | {".dll", "rb", C_EXTENSION}, 15 | {0, 0} 16 | }; 17 | 18 | dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, 19 | const char *pathname, FILE *fp) 20 | { 21 | dl_funcptr p; 22 | APIRET rc; 23 | HMODULE hDLL; 24 | char failreason[256]; 25 | char funcname[258]; 26 | 27 | rc = DosLoadModule(failreason, 28 | sizeof(failreason), 29 | pathname, 30 | &hDLL); 31 | 32 | if (rc != NO_ERROR) { 33 | char errBuf[256]; 34 | PyOS_snprintf(errBuf, sizeof(errBuf), 35 | "DLL load failed, rc = %d: %.200s", 36 | rc, failreason); 37 | PyErr_SetString(PyExc_ImportError, errBuf); 38 | return NULL; 39 | } 40 | 41 | PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname); 42 | rc = DosQueryProcAddr(hDLL, 0L, funcname, &p); 43 | if (rc != NO_ERROR) 44 | p = NULL; /* Signify Failure to Acquire Entrypoint */ 45 | return p; 46 | } 47 | -------------------------------------------------------------------------------- /bits-deps/python/Python/dynload_stub.c: -------------------------------------------------------------------------------- 1 | 2 | /* This module provides the necessary stubs for when dynamic loading is 3 | not present. */ 4 | 5 | #include "Python.h" 6 | #include "importdl.h" 7 | 8 | 9 | const struct filedescr _PyImport_DynLoadFiletab[] = { 10 | {0, 0} 11 | }; 12 | -------------------------------------------------------------------------------- /bits-deps/python/Python/formatter_string.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* Implements the string (as opposed to unicode) version of the 3 | built-in formatters for string, int, float. That is, the versions 4 | of int.__format__, etc., that take and return string objects */ 5 | 6 | #include "Python.h" 7 | #include "../Objects/stringlib/stringdefs.h" 8 | 9 | #define FORMAT_STRING _PyBytes_FormatAdvanced 10 | #define FORMAT_LONG _PyLong_FormatAdvanced 11 | #define FORMAT_INT _PyInt_FormatAdvanced 12 | #define FORMAT_FLOAT _PyFloat_FormatAdvanced 13 | #ifndef WITHOUT_COMPLEX 14 | #define FORMAT_COMPLEX _PyComplex_FormatAdvanced 15 | #endif 16 | 17 | #include "../Objects/stringlib/formatter.h" 18 | -------------------------------------------------------------------------------- /bits-deps/python/Python/formatter_unicode.c: -------------------------------------------------------------------------------- 1 | /* Implements the unicode (as opposed to string) version of the 2 | built-in formatter for unicode. That is, unicode.__format__(). */ 3 | 4 | #include "Python.h" 5 | 6 | #ifdef Py_USING_UNICODE 7 | 8 | #include "../Objects/stringlib/unicodedefs.h" 9 | 10 | #define FORMAT_STRING _PyUnicode_FormatAdvanced 11 | 12 | /* don't define FORMAT_LONG, FORMAT_FLOAT, and FORMAT_COMPLEX, since 13 | we can live with only the string versions of those. The builtin 14 | format() will convert them to unicode. */ 15 | 16 | #include "../Objects/stringlib/formatter.h" 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /bits-deps/python/Python/frozen.c: -------------------------------------------------------------------------------- 1 | 2 | /* Dummy frozen modules initializer */ 3 | 4 | #include "Python.h" 5 | 6 | /* In order to test the support for frozen modules, by default we 7 | define a single frozen module, __hello__. Loading it will print 8 | some famous words... */ 9 | 10 | /* To regenerate this data after the bytecode or marshal format has changed, 11 | go to ../Tools/freeze/ and freeze the hello.py file; then copy and paste 12 | the appropriate bytes from M___main__.c. */ 13 | 14 | static unsigned char M___hello__[] = { 15 | 99,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0, 16 | 0,115,9,0,0,0,100,0,0,71,72,100,1,0,83,40, 17 | 2,0,0,0,115,14,0,0,0,72,101,108,108,111,32,119, 18 | 111,114,108,100,46,46,46,78,40,0,0,0,0,40,0,0, 19 | 0,0,40,0,0,0,0,40,0,0,0,0,115,8,0,0, 20 | 0,104,101,108,108,111,46,112,121,115,1,0,0,0,63,1, 21 | 0,0,0,115,0,0,0,0, 22 | }; 23 | 24 | #define SIZE (int)sizeof(M___hello__) 25 | 26 | static struct _frozen _PyImport_FrozenModules[] = { 27 | /* Test module */ 28 | {"__hello__", M___hello__, SIZE}, 29 | /* Test package (negative size indicates package-ness) */ 30 | {"__phello__", M___hello__, -SIZE}, 31 | {"__phello__.spam", M___hello__, SIZE}, 32 | {0, 0, 0} /* sentinel */ 33 | }; 34 | 35 | /* Embedding apps may change this pointer to point to their favorite 36 | collection of frozen modules: */ 37 | 38 | struct _frozen *PyImport_FrozenModules = _PyImport_FrozenModules; 39 | -------------------------------------------------------------------------------- /bits-deps/python/Python/frozenmain.c: -------------------------------------------------------------------------------- 1 | 2 | /* Python interpreter main program for frozen scripts */ 3 | 4 | #include "Python.h" 5 | 6 | #ifdef MS_WINDOWS 7 | extern void PyWinFreeze_ExeInit(void); 8 | extern void PyWinFreeze_ExeTerm(void); 9 | extern int PyInitFrozenExtensions(void); 10 | #endif 11 | 12 | /* Main program */ 13 | 14 | int 15 | Py_FrozenMain(int argc, char **argv) 16 | { 17 | char *p; 18 | int n, sts; 19 | int inspect = 0; 20 | int unbuffered = 0; 21 | 22 | Py_FrozenFlag = 1; /* Suppress errors from getpath.c */ 23 | 24 | if ((p = Py_GETENV("PYTHONINSPECT")) && *p != '\0') 25 | inspect = 1; 26 | if ((p = Py_GETENV("PYTHONUNBUFFERED")) && *p != '\0') 27 | unbuffered = 1; 28 | 29 | if (unbuffered) { 30 | setbuf(stdin, (char *)NULL); 31 | setbuf(stdout, (char *)NULL); 32 | setbuf(stderr, (char *)NULL); 33 | } 34 | 35 | #ifdef MS_WINDOWS 36 | PyInitFrozenExtensions(); 37 | #endif /* MS_WINDOWS */ 38 | if (argc >= 1) 39 | Py_SetProgramName(argv[0]); 40 | Py_Initialize(); 41 | #ifdef MS_WINDOWS 42 | PyWinFreeze_ExeInit(); 43 | #endif 44 | 45 | if (Py_VerboseFlag) 46 | fprintf(stderr, "Python %s\n%s\n", 47 | Py_GetVersion(), Py_GetCopyright()); 48 | 49 | PySys_SetArgv(argc, argv); 50 | 51 | n = PyImport_ImportFrozenModule("__main__"); 52 | if (n == 0) 53 | Py_FatalError("__main__ not frozen"); 54 | if (n < 0) { 55 | PyErr_Print(); 56 | sts = 1; 57 | } 58 | else 59 | sts = 0; 60 | 61 | if (inspect && isatty((int)fileno(stdin))) 62 | sts = PyRun_AnyFile(stdin, "") != 0; 63 | 64 | #ifdef MS_WINDOWS 65 | PyWinFreeze_ExeTerm(); 66 | #endif 67 | Py_Finalize(); 68 | return sts; 69 | } 70 | -------------------------------------------------------------------------------- /bits-deps/python/Python/getcompiler.c: -------------------------------------------------------------------------------- 1 | 2 | /* Return the compiler identification, if possible. */ 3 | 4 | #include "Python.h" 5 | 6 | #ifndef COMPILER 7 | 8 | #ifdef __GNUC__ 9 | #define COMPILER "\n[GCC " __VERSION__ "]" 10 | #endif 11 | 12 | #endif /* !COMPILER */ 13 | 14 | #ifndef COMPILER 15 | 16 | #ifdef __cplusplus 17 | #define COMPILER "[C++]" 18 | #else 19 | #define COMPILER "[C]" 20 | #endif 21 | 22 | #endif /* !COMPILER */ 23 | 24 | const char * 25 | Py_GetCompiler(void) 26 | { 27 | return COMPILER; 28 | } 29 | -------------------------------------------------------------------------------- /bits-deps/python/Python/getcopyright.c: -------------------------------------------------------------------------------- 1 | /* Return the copyright string. This is updated manually. */ 2 | 3 | #include "Python.h" 4 | 5 | static char cprt[] = 6 | "\ 7 | Copyright (c) 2001-2019 Python Software Foundation.\n\ 8 | All Rights Reserved.\n\ 9 | \n\ 10 | Copyright (c) 2000 BeOpen.com.\n\ 11 | All Rights Reserved.\n\ 12 | \n\ 13 | Copyright (c) 1995-2001 Corporation for National Research Initiatives.\n\ 14 | All Rights Reserved.\n\ 15 | \n\ 16 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\n\ 17 | All Rights Reserved."; 18 | 19 | const char * 20 | Py_GetCopyright(void) 21 | { 22 | return cprt; 23 | } 24 | -------------------------------------------------------------------------------- /bits-deps/python/Python/getcwd.c: -------------------------------------------------------------------------------- 1 | 2 | /* Two PD getcwd() implementations. 3 | Author: Guido van Rossum, CWI Amsterdam, Jan 1991, . */ 4 | 5 | #include 6 | #include 7 | 8 | #ifdef HAVE_GETWD 9 | 10 | /* Version for BSD systems -- use getwd() */ 11 | 12 | #ifdef HAVE_SYS_PARAM_H 13 | #include 14 | #endif 15 | 16 | #ifndef MAXPATHLEN 17 | #if defined(PATH_MAX) && PATH_MAX > 1024 18 | #define MAXPATHLEN PATH_MAX 19 | #else 20 | #define MAXPATHLEN 1024 21 | #endif 22 | #endif 23 | 24 | extern char *getwd(char *); 25 | 26 | char * 27 | getcwd(char *buf, int size) 28 | { 29 | char localbuf[MAXPATHLEN+1]; 30 | char *ret; 31 | 32 | if (size <= 0) { 33 | errno = EINVAL; 34 | return NULL; 35 | } 36 | ret = getwd(localbuf); 37 | if (ret != NULL && strlen(localbuf) >= (size_t)size) { 38 | errno = ERANGE; 39 | return NULL; 40 | } 41 | if (ret == NULL) { 42 | errno = EACCES; /* Most likely error */ 43 | return NULL; 44 | } 45 | strncpy(buf, localbuf, size); 46 | return buf; 47 | } 48 | 49 | #else /* !HAVE_GETWD */ 50 | 51 | /* Version for really old UNIX systems -- use pipe from pwd */ 52 | 53 | #ifndef PWD_CMD 54 | #define PWD_CMD "/bin/pwd" 55 | #endif 56 | 57 | char * 58 | getcwd(char *buf, int size) 59 | { 60 | FILE *fp; 61 | char *p; 62 | if (size <= 0) { 63 | errno = EINVAL; 64 | return NULL; 65 | } 66 | if ((fp = popen(PWD_CMD, "r")) == NULL) 67 | return NULL; 68 | if (fgets(buf, size, fp) == NULL || pclose(fp) != 0) { 69 | errno = EACCES; /* Most likely error */ 70 | return NULL; 71 | } 72 | for (p = buf; *p != '\n'; p++) { 73 | if (*p == '\0') { 74 | errno = ERANGE; 75 | return NULL; 76 | } 77 | } 78 | *p = '\0'; 79 | return buf; 80 | } 81 | 82 | #endif /* !HAVE_GETWD */ 83 | -------------------------------------------------------------------------------- /bits-deps/python/Python/getplatform.c: -------------------------------------------------------------------------------- 1 | 2 | #include "Python.h" 3 | 4 | #ifndef PLATFORM 5 | #define PLATFORM "unknown" 6 | #endif 7 | 8 | const char * 9 | Py_GetPlatform(void) 10 | { 11 | return PLATFORM; 12 | } 13 | -------------------------------------------------------------------------------- /bits-deps/python/Python/getversion.c: -------------------------------------------------------------------------------- 1 | 2 | /* Return the full version string. */ 3 | 4 | #include "Python.h" 5 | 6 | #include "patchlevel.h" 7 | 8 | const char * 9 | Py_GetVersion(void) 10 | { 11 | static char version[250]; 12 | PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s", 13 | PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler()); 14 | return version; 15 | } 16 | -------------------------------------------------------------------------------- /bits-deps/python/Python/importdl.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_IMPORTDL_H 2 | #define Py_IMPORTDL_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | /* Definitions for dynamic loading of extension modules */ 10 | enum filetype { 11 | SEARCH_ERROR, 12 | PY_SOURCE, 13 | PY_COMPILED, 14 | C_EXTENSION, 15 | PY_RESOURCE, /* Mac only */ 16 | PKG_DIRECTORY, 17 | C_BUILTIN, 18 | PY_FROZEN, 19 | PY_CODERESOURCE, /* Mac only */ 20 | IMP_HOOK 21 | }; 22 | 23 | struct filedescr { 24 | char *suffix; 25 | char *mode; 26 | enum filetype type; 27 | }; 28 | extern struct filedescr * _PyImport_Filetab; 29 | extern const struct filedescr _PyImport_DynLoadFiletab[]; 30 | 31 | extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname, 32 | FILE *); 33 | 34 | /* Max length of module suffix searched for -- accommodates "module.slb" */ 35 | #define MAXSUFFIXSIZE 12 36 | 37 | #ifdef MS_WINDOWS 38 | #include 39 | typedef FARPROC dl_funcptr; 40 | #else 41 | #if defined(PYOS_OS2) && !defined(PYCC_GCC) 42 | #include 43 | typedef int (* APIENTRY dl_funcptr)(); 44 | #else 45 | typedef void (*dl_funcptr)(void); 46 | #endif 47 | #endif 48 | 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | #endif /* !Py_IMPORTDL_H */ 54 | -------------------------------------------------------------------------------- /bits-deps/python/Python/makeopcodetargets.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | """Generate C code for the jump table of the threaded code interpreter 3 | (for compilers supporting computed gotos or "labels-as-values", such as gcc). 4 | """ 5 | 6 | # This code should stay compatible with Python 2.3, at least while 7 | # some of the buildbots have Python 2.3 as their system Python. 8 | 9 | import imp 10 | import os 11 | 12 | 13 | def find_module(modname): 14 | """Finds and returns a module in the local dist/checkout. 15 | """ 16 | modpath = os.path.join( 17 | os.path.dirname(os.path.dirname(__file__)), "Lib") 18 | return imp.load_module(modname, *imp.find_module(modname, [modpath])) 19 | 20 | def write_contents(f): 21 | """Write C code contents to the target file object. 22 | """ 23 | opcode = find_module("opcode") 24 | targets = ['_unknown_opcode'] * 256 25 | for opname, op in opcode.opmap.items(): 26 | if opname == "STOP_CODE": 27 | continue 28 | targets[op] = "TARGET_%s" % opname.replace("+0", " ").replace("+", "_") 29 | f.write("static void *opcode_targets[256] = {\n") 30 | f.write(",\n".join([" &&%s" % s for s in targets])) 31 | f.write("\n};\n") 32 | 33 | 34 | if __name__ == "__main__": 35 | import sys 36 | assert len(sys.argv) < 3, "Too many arguments" 37 | if len(sys.argv) == 2: 38 | target = sys.argv[1] 39 | else: 40 | target = "Python/opcode_targets.h" 41 | f = open(target, "w") 42 | try: 43 | write_contents(f) 44 | finally: 45 | f.close() 46 | -------------------------------------------------------------------------------- /bits-deps/python/Python/pyfpe.c: -------------------------------------------------------------------------------- 1 | #include "pyconfig.h" 2 | #include "pyfpe.h" 3 | /* 4 | * The signal handler for SIGFPE is actually declared in an external 5 | * module fpectl, or as preferred by the user. These variable 6 | * definitions are required in order to compile Python without 7 | * getting missing externals, but to actually handle SIGFPE requires 8 | * defining a handler and enabling generation of SIGFPE. 9 | */ 10 | 11 | #ifdef WANT_SIGFPE_HANDLER 12 | jmp_buf PyFPE_jbuf; 13 | int PyFPE_counter = 0; 14 | #endif 15 | 16 | /* Have this outside the above #ifdef, since some picky ANSI compilers issue a 17 | warning when compiling an empty file. */ 18 | 19 | double 20 | PyFPE_dummy(void *dummy) 21 | { 22 | return 1.0; 23 | } 24 | -------------------------------------------------------------------------------- /bits-deps/python/Python/pymath.c: -------------------------------------------------------------------------------- 1 | #include "Python.h" 2 | 3 | #ifdef X87_DOUBLE_ROUNDING 4 | /* On x86 platforms using an x87 FPU, this function is called from the 5 | Py_FORCE_DOUBLE macro (defined in pymath.h) to force a floating-point 6 | number out of an 80-bit x87 FPU register and into a 64-bit memory location, 7 | thus rounding from extended precision to double precision. */ 8 | double _Py_force_double(double x) 9 | { 10 | volatile double y; 11 | y = x; 12 | return y; 13 | } 14 | #endif 15 | 16 | #ifdef HAVE_GCC_ASM_FOR_X87 17 | 18 | /* inline assembly for getting and setting the 387 FPU control word on 19 | gcc/x86 */ 20 | 21 | unsigned short _Py_get_387controlword(void) { 22 | unsigned short cw; 23 | __asm__ __volatile__ ("fnstcw %0" : "=m" (cw)); 24 | return cw; 25 | } 26 | 27 | void _Py_set_387controlword(unsigned short cw) { 28 | __asm__ __volatile__ ("fldcw %0" : : "m" (cw)); 29 | } 30 | 31 | #endif 32 | 33 | 34 | #ifndef HAVE_HYPOT 35 | double hypot(double x, double y) 36 | { 37 | double yx; 38 | 39 | x = fabs(x); 40 | y = fabs(y); 41 | if (x < y) { 42 | double temp = x; 43 | x = y; 44 | y = temp; 45 | } 46 | if (x == 0.) 47 | return 0.; 48 | else { 49 | yx = y/x; 50 | return x*sqrt(1.+yx*yx); 51 | } 52 | } 53 | #endif /* HAVE_HYPOT */ 54 | 55 | #ifndef HAVE_COPYSIGN 56 | double 57 | copysign(double x, double y) 58 | { 59 | /* use atan2 to distinguish -0. from 0. */ 60 | if (y > 0. || (y == 0. && atan2(y, -1.) > 0.)) { 61 | return fabs(x); 62 | } else { 63 | return -fabs(x); 64 | } 65 | } 66 | #endif /* HAVE_COPYSIGN */ 67 | 68 | #ifndef HAVE_ROUND 69 | double 70 | round(double x) 71 | { 72 | double absx, y; 73 | absx = fabs(x); 74 | y = floor(absx); 75 | if (absx - y >= 0.5) 76 | y += 1.0; 77 | return copysign(y, x); 78 | } 79 | #endif /* HAVE_ROUND */ 80 | -------------------------------------------------------------------------------- /bits-deps/python/Python/pystrcmp.c: -------------------------------------------------------------------------------- 1 | /* Cross platform case insensitive string compare functions 2 | */ 3 | 4 | #include "Python.h" 5 | 6 | int 7 | PyOS_mystrnicmp(const char *s1, const char *s2, Py_ssize_t size) 8 | { 9 | if (size == 0) 10 | return 0; 11 | while ((--size > 0) && 12 | (tolower((unsigned)*s1) == tolower((unsigned)*s2))) { 13 | if (!*s1++ || !*s2++) 14 | break; 15 | } 16 | return tolower((unsigned)*s1) - tolower((unsigned)*s2); 17 | } 18 | 19 | int 20 | PyOS_mystricmp(const char *s1, const char *s2) 21 | { 22 | while (*s1 && (tolower((unsigned)*s1++) == tolower((unsigned)*s2++))) { 23 | ; 24 | } 25 | return (tolower((unsigned)*s1) - tolower((unsigned)*s2)); 26 | } 27 | -------------------------------------------------------------------------------- /bits-deps/python/Python/sigcheck.c: -------------------------------------------------------------------------------- 1 | 2 | /* Sigcheck is similar to intrcheck() but sets an exception when an 3 | interrupt occurs. It can't be in the intrcheck.c file since that 4 | file (and the whole directory it is in) doesn't know about objects 5 | or exceptions. It can't be in errors.c because it can be 6 | overridden (at link time) by a more powerful version implemented in 7 | signalmodule.c. */ 8 | 9 | #include "Python.h" 10 | 11 | /* ARGSUSED */ 12 | int 13 | PyErr_CheckSignals(void) 14 | { 15 | if (!PyOS_InterruptOccurred()) 16 | return 0; 17 | PyErr_SetNone(PyExc_KeyboardInterrupt); 18 | return -1; 19 | } 20 | -------------------------------------------------------------------------------- /bits-deps/python/Python/strdup.c: -------------------------------------------------------------------------------- 1 | /* strdup() replacement (from stdwin, if you must know) */ 2 | 3 | #include "pgenheaders.h" 4 | 5 | char * 6 | strdup(const char *str) 7 | { 8 | if (str != NULL) { 9 | register char *copy = malloc(strlen(str) + 1); 10 | if (copy != NULL) 11 | return strcpy(copy, str); 12 | } 13 | return NULL; 14 | } 15 | -------------------------------------------------------------------------------- /bits-deps/python/Python/thread_foobar.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Initialization. 4 | */ 5 | static void 6 | PyThread__init_thread(void) 7 | { 8 | } 9 | 10 | /* 11 | * Thread support. 12 | */ 13 | long 14 | PyThread_start_new_thread(void (*func)(void *), void *arg) 15 | { 16 | int success = 0; /* init not needed when SOLARIS_THREADS and */ 17 | /* C_THREADS implemented properly */ 18 | 19 | dprintf(("PyThread_start_new_thread called\n")); 20 | if (!initialized) 21 | PyThread_init_thread(); 22 | return success < 0 ? -1 : 0; 23 | } 24 | 25 | long 26 | PyThread_get_thread_ident(void) 27 | { 28 | if (!initialized) 29 | PyThread_init_thread(); 30 | } 31 | 32 | void 33 | PyThread_exit_thread(void) 34 | { 35 | dprintf(("PyThread_exit_thread called\n")); 36 | if (!initialized) 37 | exit(0); 38 | } 39 | 40 | /* 41 | * Lock support. 42 | */ 43 | PyThread_type_lock 44 | PyThread_allocate_lock(void) 45 | { 46 | 47 | dprintf(("PyThread_allocate_lock called\n")); 48 | if (!initialized) 49 | PyThread_init_thread(); 50 | 51 | dprintf(("PyThread_allocate_lock() -> %p\n", lock)); 52 | return (PyThread_type_lock) lock; 53 | } 54 | 55 | void 56 | PyThread_free_lock(PyThread_type_lock lock) 57 | { 58 | dprintf(("PyThread_free_lock(%p) called\n", lock)); 59 | } 60 | 61 | int 62 | PyThread_acquire_lock(PyThread_type_lock lock, int waitflag) 63 | { 64 | int success; 65 | 66 | dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag)); 67 | dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success)); 68 | return success; 69 | } 70 | 71 | void 72 | PyThread_release_lock(PyThread_type_lock lock) 73 | { 74 | dprintf(("PyThread_release_lock(%p) called\n", lock)); 75 | } 76 | -------------------------------------------------------------------------------- /bits/include/datatype.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef DATATYPE_H 30 | #define DATATYPE_H 31 | 32 | #include 33 | 34 | typedef grub_uint8_t U8; 35 | typedef grub_uint16_t U16; 36 | typedef grub_uint32_t U32; 37 | typedef grub_uint64_t U64; 38 | typedef grub_uint32_t bool; 39 | #define true 1 40 | #define false 0 41 | 42 | #ifndef NULL 43 | #define NULL ((void *) 0) 44 | #endif 45 | 46 | #endif /* DATATYPE_H */ 47 | -------------------------------------------------------------------------------- /bits/include/portable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef PORTABLE_H 30 | #define PORTABLE_H 31 | 32 | #include 33 | #include 34 | #include /* For dprintf */ 35 | 36 | #define get_time_ms grub_get_time_ms 37 | #define memcpy grub_memcpy 38 | 39 | #if defined(__i386__) 40 | #define asmlinkage __attribute__((cdecl,regparm(0))) 41 | #elif defined(__x86_64__) 42 | #define asmlinkage 43 | #endif 44 | 45 | #define attr_noreturn __attribute__((noreturn)) 46 | #define attr_packed __attribute__((packed)) 47 | 48 | #endif /* PORTABLE_H */ 49 | -------------------------------------------------------------------------------- /bits/include/stdint.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef STDINT_H 30 | #define STDINT_H 31 | 32 | #include 33 | 34 | typedef grub_int8_t int8_t; 35 | typedef grub_uint8_t uint8_t; 36 | typedef grub_int16_t int16_t; 37 | typedef grub_uint16_t uint16_t; 38 | typedef grub_int32_t int32_t; 39 | typedef grub_uint32_t uint32_t; 40 | typedef grub_int64_t int64_t; 41 | typedef grub_uint64_t uint64_t; 42 | typedef long intptr_t; 43 | typedef unsigned long uintptr_t; 44 | 45 | #define UINT32_C(c) c ## U 46 | #define UINT64_C(c) c ## ULL 47 | 48 | #endif /* STDINT_H */ 49 | -------------------------------------------------------------------------------- /bits/python/acpimodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "Python.h" 30 | 31 | PyMODINIT_FUNC init_acpi_module(void); 32 | -------------------------------------------------------------------------------- /bits/python/assert.h: -------------------------------------------------------------------------------- 1 | #define assert(x) _assert(__FILE__, __LINE__, !!(x), #x) 2 | -------------------------------------------------------------------------------- /bits/python/bitsmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "Python.h" 30 | 31 | PyMODINIT_FUNC init_bits(void); 32 | -------------------------------------------------------------------------------- /bits/python/ctype.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits/python/ctype.h -------------------------------------------------------------------------------- /bits/python/dlfcn.h: -------------------------------------------------------------------------------- 1 | #ifndef DLFCN_H 2 | #define DLFCN_H 3 | 4 | #define RTLD_NOW 2 5 | 6 | int dlclose(void *handle); 7 | char *dlerror(void); 8 | void *dlopen(const char *filename, int flag); 9 | void *dlsym(void *handle, const char *symbol); 10 | 11 | #endif /* DLFCN_H */ 12 | -------------------------------------------------------------------------------- /bits/python/efimodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifdef GRUB_MACHINE_EFI 30 | 31 | #ifndef EFIMODULE_H 32 | #define EFIMODULE_H 33 | 34 | #include "Python.h" 35 | #include "pyunconfig.h" 36 | 37 | #include 38 | 39 | PyMODINIT_FUNC init_efi(void); 40 | 41 | #endif /* EFIMODULE_H */ 42 | 43 | #endif /* GRUB_MACHINE_EFI */ 44 | -------------------------------------------------------------------------------- /bits/python/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef ERRNO_H 2 | #define ERRNO_H 3 | 4 | #include 5 | 6 | #define errno grub_errno 7 | 8 | #define EDOM GRUB_ERR_BAD_ARGUMENT 9 | #define EINVAL GRUB_ERR_BAD_NUMBER 10 | #define EISDIR GRUB_ERR_BAD_FILE_TYPE 11 | #define ENOENT GRUB_ERR_FILE_NOT_FOUND 12 | #define ENOMEM GRUB_ERR_OUT_OF_MEMORY 13 | #define ENOTDIR GRUB_ERR_BAD_FILE_TYPE 14 | #define ENXIO GRUB_ERR_UNKNOWN_DEVICE 15 | #define ERANGE GRUB_ERR_OUT_OF_RANGE 16 | #define EINTR GRUB_ERR_TIMEOUT 17 | 18 | #endif /* ERRNO_H */ 19 | -------------------------------------------------------------------------------- /bits/python/fcntl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits/python/fcntl.h -------------------------------------------------------------------------------- /bits/python/grubunconfig.h: -------------------------------------------------------------------------------- 1 | /* This header undefines everything defined in grub header files that conflict 2 | * with Python, including config.h and various generic names. */ 3 | 4 | #ifndef GRUBUNCONFIG_H 5 | #define GRUBUNCONFIG_H 6 | 7 | #undef LOCAL 8 | 9 | /* config.h */ 10 | #undef ADDR32 11 | #undef BSS_START_SYMBOL 12 | #undef DATA32 13 | #undef ENABLE_NLS 14 | #undef END_SYMBOL 15 | #undef HAVE_ASPRINTF 16 | #undef HAVE_DCGETTEXT 17 | #undef HAVE_FT2BUILD_H 18 | #undef HAVE_GETTEXT 19 | #undef HAVE_INTTYPES_H 20 | #undef HAVE_MEMALIGN 21 | #undef HAVE_MEMORY_H 22 | #undef HAVE_POSIX_MEMALIGN 23 | #undef HAVE_STDINT_H 24 | #undef HAVE_STDLIB_H 25 | #undef HAVE_STRINGS_H 26 | #undef HAVE_STRING_H 27 | #undef HAVE_SYS_STAT_H 28 | #undef HAVE_SYS_TYPES_H 29 | #undef HAVE_UNISTD_H 30 | #undef HAVE_VASPRINTF 31 | #undef HAVE___ASHLDI3 32 | #undef HAVE___ASHRDI3 33 | #undef HAVE___BSWAPDI2 34 | #undef HAVE___BSWAPSI2 35 | #undef HAVE___LSHRDI3 36 | #undef HAVE___UCMPDI2 37 | #undef PACKAGE 38 | #undef PACKAGE_BUGREPORT 39 | #undef PACKAGE_NAME 40 | #undef PACKAGE_STRING 41 | #undef PACKAGE_TARNAME 42 | #undef PACKAGE_URL 43 | #undef PACKAGE_VERSION 44 | #undef SIZEOF_LONG 45 | #undef SIZEOF_VOID_P 46 | #undef STDC_HEADERS 47 | #undef _ALL_SOURCE 48 | #undef _GNU_SOURCE 49 | #undef _POSIX_PTHREAD_SEMANTICS 50 | #undef _TANDEM_SOURCE 51 | #undef __EXTENSIONS__ 52 | #undef VERSION 53 | #undef WORDS_BIGENDIAN 54 | #undef YYTEXT_POINTER 55 | 56 | #endif /* GRUBUNCONFIG_H */ 57 | -------------------------------------------------------------------------------- /bits/python/locale.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits/python/locale.h -------------------------------------------------------------------------------- /bits/python/math.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits/python/math.h -------------------------------------------------------------------------------- /bits/python/pyfsmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef PYFSMODULE_H 30 | #define PYFSMODULE_H 31 | 32 | #include "Python.h" 33 | #include "pyunconfig.h" 34 | 35 | #include 36 | 37 | PyMODINIT_FUNC init_pyfs(void); 38 | grub_err_t do_pyfs_dir(const char *path, int (*hook)(const char *filename, const struct grub_dirhook_info *info, void *hook_data), void*data); 39 | grub_err_t do_pyfs_open(const char *name, grub_off_t *size); 40 | grub_ssize_t do_pyfs_read(const char *name, grub_off_t offset, void *buf, grub_size_t len); 41 | 42 | #endif /* PYFSMODULE_H */ 43 | -------------------------------------------------------------------------------- /bits/python/pyunconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef PYUNCONFIG_H 2 | #define PYUNCONFIG_H 3 | 4 | #undef SIZEOF_LONG 5 | #undef SIZEOF_VOID_P 6 | 7 | #endif /* PYUNCONFIG_H */ 8 | -------------------------------------------------------------------------------- /bits/python/smpmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef SMPMODULE_H 30 | #define SMPMODULE_H 31 | 32 | #include "Python.h" 33 | #include "pyunconfig.h" 34 | 35 | #include 36 | 37 | PyMODINIT_FUNC init_smp_module(void); 38 | 39 | #endif /* SMPMODULE_H */ 40 | -------------------------------------------------------------------------------- /bits/python/stdio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits/python/stdio.h -------------------------------------------------------------------------------- /bits/python/stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef STDLIB_H 2 | #define STDLIB_H 3 | 4 | #include 5 | 6 | #define abort() grub_fatal("%s:%u: Internal error: Python called abort()\n", __FILE__, __LINE__) 7 | 8 | #endif /* STDLIB_H */ 9 | -------------------------------------------------------------------------------- /bits/python/string.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits/python/string.h -------------------------------------------------------------------------------- /bits/python/sys/types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits/python/sys/types.h -------------------------------------------------------------------------------- /bits/python/time.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/bits/python/time.h -------------------------------------------------------------------------------- /bits/python/wchar.h: -------------------------------------------------------------------------------- 1 | #ifndef WCHAR_H 2 | #define WCHAR_H 3 | 4 | size_t wcslen(const wchar_t *s); 5 | 6 | #endif /* WCHAR_H */ 7 | -------------------------------------------------------------------------------- /bits/smp/barrier.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "barrier.h" 30 | 31 | void set_control(U32 * control, U32 value) 32 | { 33 | *control = value; 34 | } 35 | -------------------------------------------------------------------------------- /bits/smp/barrier.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* barrier.h defines synchronization primitives for use by SMP. These barriers 30 | * must be defined separately from smp.c so that the compiler does not optimize 31 | * across them. */ 32 | 33 | #ifndef BARRIER_H 34 | #define BARRIER_H 35 | 36 | #include "datatype.h" 37 | 38 | #define BSP_IN_CONTROL 0 39 | #define AP_IN_CONTROL 1 40 | 41 | /* Set control to the specified value. */ 42 | void set_control(U32 * control, U32 value); 43 | 44 | /* wait_for_control defined as a function pointer elsewhere */ 45 | 46 | #endif /* BARRIER_H */ 47 | -------------------------------------------------------------------------------- /bits/smp/smpequ.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, Intel Corporation 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | * Neither the name of Intel Corporation nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #if defined(__x86_64__) 30 | #define SIZEOF_POINTER 8 31 | #elif defined(__i386__) 32 | #define SIZEOF_POINTER 4 33 | #endif 34 | 35 | #define AP_STACK 0x1000 36 | #define AP_DATA (AP_STACK - 0x800) 37 | #define BLOCK (AP_DATA - 4) 38 | #define ASLEEP (BLOCK - 4) 39 | #define FUNCTIONPTR (ASLEEP - SIZEOF_POINTER) 40 | #define PARAM (FUNCTIONPTR - SIZEOF_POINTER) 41 | #define PAGETABLE (PARAM - 4) 42 | #define AP_CODE_MAX PAGETABLE 43 | -------------------------------------------------------------------------------- /cachetest/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = cachetest; 5 | common = contrib/cachetest/cachetest.c; 6 | enable = i386_efi; 7 | enable = i386_pc; 8 | }; 9 | -------------------------------------------------------------------------------- /cachetest/README.md: -------------------------------------------------------------------------------- 1 | # CacheTest 2 | 3 | ### Project description 4 | 5 | CacheTest is a module for GNU GRUB environment that measures bandwidth/latency of selective cache levels without OS interference. Selectivity is achieved using strided accesses and verified using CPU performance counters. 6 | 7 | The software was used in Intel Haswell CPU cache performance research. The results have been published in the following scientific papers: 8 | 9 | * Petrov V., Moltchanov D., Komar M., Antonov A., Kustarev P., Rakheija S., Koucheryavy Y. Terahertz Band Intra-Chip Communications: Can Wireless Links Scale Modern x86 CPUs? // IEEE Access - 2017, Vol. 5, pp. 6095-6109 10 | 11 | * Moltchanov D., Antonov A., Kluchev A., Borunova K., Kustarev P., Petrov V., Koucheryavy Y.A., Platunov A. Statistical Traffic Properties and Model Inference for Shared Cache Interface in Multi-Core CPUs // IEEE Access - 2016, Vol. 4, pp. 4829-4839 12 | 13 | For questions, please contact antonov.alex.alex@gmail.com 14 | -------------------------------------------------------------------------------- /chip8/CHIP8ROM.ROM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/chip8/CHIP8ROM.ROM -------------------------------------------------------------------------------- /chip8/LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Alexander Babayants 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /chip8/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = chip8; 5 | common = contrib/chip8/main.c; 6 | common = contrib/chip8/c8display.c; 7 | common = contrib/chip8/c8fs.c; 8 | common = contrib/chip8/c8input.c; 9 | common = contrib/chip8/c8interpreter.c; 10 | common = contrib/chip8/c8sound.c; 11 | enable = efi; 12 | }; -------------------------------------------------------------------------------- /chip8/c8display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "debug.h" 4 | 5 | #define DISPLAY_WIDTH 64 6 | #define DISPLAY_HEIGHT 32 7 | #define PX_SCALE_FACTOR 8 8 | 9 | typedef enum 10 | { 11 | DS_OK = 0, 12 | DS_BUSY, 13 | DS_ERROR 14 | } display_status_t; 15 | 16 | typedef enum 17 | { 18 | PX_CLEAN = 0, 19 | PX_DIRTY, 20 | PX_ERROR 21 | } px_status_t; 22 | 23 | typedef enum 24 | { 25 | PX_BLANK = 0, 26 | PX_FILLED 27 | } px_content_t; 28 | 29 | display_status_t display_init(void); 30 | display_status_t display_clear(void); 31 | px_status_t display_px_set(unsigned const int x, unsigned const int y, const px_content_t value); 32 | px_status_t display_px_xor(unsigned const int x, unsigned const int y, const px_content_t value); 33 | px_status_t display_px_flip(unsigned const int x, unsigned const int y); -------------------------------------------------------------------------------- /chip8/c8fs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "c8fs.h" 11 | #include "c8rom.h" 12 | 13 | grub_efi_status_t read_file(char *path, grub_ssize_t *buf_sz, void *buf) 14 | { 15 | if (!path) 16 | { 17 | grub_memcpy(buf, CHIP8ROM, CHIP8ROM_LEN); 18 | *buf_sz = CHIP8ROM_LEN; 19 | return GRUB_EFI_SUCCESS; 20 | } 21 | 22 | grub_file_t file = 0; 23 | 24 | file = grub_file_open (path, GRUB_FILE_TYPE_CAT); 25 | if (!file) 26 | { 27 | grub_printf("Failed opening file \"%s\": not found\n", path); 28 | return GRUB_EFI_NOT_FOUND; 29 | } 30 | 31 | *buf_sz = grub_file_size (file); 32 | 33 | if (*buf_sz > 4096) 34 | { 35 | grub_printf("Failed opening file \"%s\": out of resources\n", path); 36 | return GRUB_EFI_OUT_OF_RESOURCES; 37 | } 38 | 39 | if (grub_file_read (file, buf, *buf_sz) != *buf_sz) 40 | { 41 | grub_printf("Failed opening file \"%s\": bad buffer size\n", path); 42 | return GRUB_EFI_BAD_BUFFER_SIZE; 43 | } 44 | 45 | return GRUB_EFI_SUCCESS; 46 | } -------------------------------------------------------------------------------- /chip8/c8fs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "debug.h" 8 | 9 | grub_efi_status_t read_file(char *path, grub_ssize_t *buf_sz, void *buf); -------------------------------------------------------------------------------- /chip8/c8input.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "c8input.h" 9 | 10 | input_status_t input_init() 11 | { 12 | return IN_OK; 13 | } 14 | 15 | key_event_t input_next() 16 | { 17 | int key = 0; 18 | 19 | key = grub_getkey_noblock (); 20 | 21 | switch (key) 22 | { 23 | case '0': 24 | return KB_0; 25 | 26 | case '1': 27 | return KB_1; 28 | 29 | case '2': 30 | return KB_2; 31 | 32 | case '3': 33 | return KB_3; 34 | 35 | case '4': 36 | return KB_4; 37 | 38 | case '5': 39 | return KB_5; 40 | 41 | case '6': 42 | return KB_6; 43 | 44 | case '7': 45 | return KB_7; 46 | 47 | case '8': 48 | return KB_8; 49 | 50 | case '9': 51 | return KB_9; 52 | 53 | case 'a': 54 | return KB_A; 55 | 56 | case 'b': 57 | return KB_B; 58 | 59 | case 'c': 60 | return KB_C; 61 | 62 | case 'd': 63 | return KB_D; 64 | 65 | case 'e': 66 | return KB_E; 67 | 68 | case 'f': 69 | return KB_F; 70 | 71 | case 'z': 72 | return KB_ESC; 73 | 74 | case GRUB_TERM_ESC: 75 | return KB_ESC; 76 | } 77 | 78 | return KB_PASS; 79 | } -------------------------------------------------------------------------------- /chip8/c8input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef enum 4 | { 5 | IN_OK = 0, 6 | IN_ERROR 7 | } input_status_t; 8 | 9 | typedef enum 10 | { 11 | KB_0 = 0, 12 | KB_1, 13 | KB_2, 14 | KB_3, 15 | KB_4, 16 | KB_5, 17 | KB_6, 18 | KB_7, 19 | KB_8, 20 | KB_9, 21 | KB_A, 22 | KB_B, 23 | KB_C, 24 | KB_D, 25 | KB_E, 26 | KB_F, 27 | KB_ESC, 28 | KB_PASS, 29 | KB_ERROR 30 | } key_event_t; 31 | 32 | input_status_t input_init(void); 33 | key_event_t input_next(void); -------------------------------------------------------------------------------- /chip8/c8interpreter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "c8fs.h" 13 | #include "c8input.h" 14 | #include "c8display.h" 15 | #include "c8sound.h" 16 | #include "c8opcodes.h" 17 | 18 | #include "debug.h" 19 | 20 | #define CLOCK_RATE 2000 /* Delay for CPU clock in microseconds. */ 21 | #define TIMER_RATE 10 /* CPU clocks per timer tick. */ 22 | 23 | typedef enum 24 | { 25 | INT_OK = 0, 26 | INT_INIT_FAILED, 27 | INT_EXEC_FAILED, 28 | INT_UNKNOWN_OP 29 | } interpreter_status_t; 30 | 31 | typedef enum 32 | { 33 | EX_NORMAL = 0, 34 | EX_AWAITS_KEY, 35 | EX_STOP 36 | } execution_state_t; 37 | 38 | struct interpreter_state 39 | { 40 | grub_efi_uint8_t memory[4096]; 41 | grub_efi_uint16_t stack[16]; 42 | grub_efi_uint8_t V[16]; 43 | grub_efi_uint16_t PC; 44 | grub_efi_uint16_t I; 45 | grub_efi_uint8_t delay_timer; 46 | grub_efi_uint8_t sound_timer; 47 | execution_state_t execution_state; 48 | key_event_t last_key; 49 | grub_efi_uint8_t X; 50 | grub_efi_uint8_t SP; 51 | grub_efi_uintn_t cycle; 52 | grub_efi_uintn_t timer_rate; 53 | }; 54 | 55 | interpreter_status_t interpreter_init(char *rom_file, char *image_file, struct interpreter_state *state); 56 | interpreter_status_t interpreter_loop(struct interpreter_state *state); -------------------------------------------------------------------------------- /chip8/c8rom.h: -------------------------------------------------------------------------------- 1 | unsigned char CHIP8ROM[] = { 2 | 0xf0, 0x90, 0x90, 0x90, 0xf0, 0x20, 0x60, 0x20, 0x20, 0x70, 0xf0, 0x10, 3 | 0xf0, 0x80, 0xf0, 0xf0, 0x10, 0xf0, 0x10, 0xf0, 0x90, 0x90, 0xf0, 0x10, 4 | 0x10, 0xf0, 0x80, 0xf0, 0x10, 0xf0, 0xf0, 0x80, 0xf0, 0x90, 0xf0, 0xf0, 5 | 0x10, 0x20, 0x40, 0x40, 0xf0, 0x90, 0xf0, 0x90, 0xf0, 0xf0, 0x90, 0xf0, 6 | 0x10, 0xf0, 0xf0, 0x90, 0xf0, 0x90, 0x90, 0xe0, 0x90, 0xe0, 0x90, 0xe0, 7 | 0xf0, 0x80, 0x80, 0x80, 0xf0, 0xe0, 0x90, 0x90, 0x90, 0xe0, 0xf0, 0x80, 8 | 0xf0, 0x80, 0xf0, 0xf0, 0x80, 0xf0, 0x80, 0x80 9 | }; 10 | unsigned int CHIP8ROM_LEN = 80; 11 | -------------------------------------------------------------------------------- /chip8/c8sound.c: -------------------------------------------------------------------------------- 1 | #include "c8sound.h" 2 | 3 | void beep() 4 | { 5 | /* As far as I know, UEFI has no sound interfaces by default, one 6 | should use an external driver to make it work. So this is only 7 | a stub. */ 8 | return; 9 | } -------------------------------------------------------------------------------- /chip8/c8sound.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void beep(void); -------------------------------------------------------------------------------- /chip8/debug.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define DEBUG_MODE 0 6 | 7 | #define LOG(fmt, ...) \ 8 | do { if (DEBUG_MODE) grub_printf(fmt, __VA_ARGS__); } while (0) 9 | -------------------------------------------------------------------------------- /deepin_gfxmode/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = deepin_gfxmode; 5 | common = contrib/deepin_gfxmode/deepin_gfxmode.c; 6 | }; -------------------------------------------------------------------------------- /fwconfig/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = fwconfig; 5 | common = contrib/fwconfig/fwconfig.c; 6 | enable = x86; 7 | }; -------------------------------------------------------------------------------- /gameboy/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = gameboy; 5 | common = contrib/gameboy/platforms/main.c; 6 | common = contrib/gameboy/platforms/logger.c; 7 | common = contrib/gameboy/platforms/files.c; 8 | common = contrib/gameboy/platforms/debugger.c; 9 | common = contrib/gameboy/platforms/libs.c; 10 | common = contrib/gameboy/core/emu.c; 11 | common = contrib/gameboy/core/cpu.c; 12 | common = contrib/gameboy/core/rom_info.c; 13 | common = contrib/gameboy/core/graphics.c; 14 | common = contrib/gameboy/core/sprite_priorities.c; 15 | common = contrib/gameboy/core/timers.c; 16 | common = contrib/gameboy/core/interrupts.c; 17 | common = contrib/gameboy/core/lcd.c; 18 | common = contrib/gameboy/core/serial_io.c; 19 | common = contrib/gameboy/core/mmu/memory.c; 20 | common = contrib/gameboy/core/mmu/mbc.c; 21 | common = contrib/gameboy/core/mmu/hdma.c; 22 | common = contrib/gameboy/core/mmu/mmm01.c; 23 | common = contrib/gameboy/core/mmu/mbc0.c; 24 | common = contrib/gameboy/core/mmu/mbc1.c; 25 | common = contrib/gameboy/core/mmu/mbc2.c; 26 | common = contrib/gameboy/core/mmu/mbc3.c; 27 | common = contrib/gameboy/core/mmu/mbc5.c; 28 | common = contrib/gameboy/core/mmu/huc1.c; 29 | common = contrib/gameboy/core/mmu/huc3.c; 30 | common = contrib/gameboy/shared_libs/framerate.c; 31 | common = contrib/gameboy/shared_libs/graphics.c; 32 | common = contrib/gameboy/shared_libs/joypad.c; 33 | common = contrib/gameboy/shared_libs/serial_io.c; 34 | common = contrib/gameboy/shared_libs/sound.c; 35 | enable = efi; 36 | cflags = '$(CFLAGS_POSIX)'; 37 | cppflags = '-I$(srcdir)/lib/posix_wrap'; 38 | }; -------------------------------------------------------------------------------- /gameboy/README: -------------------------------------------------------------------------------- 1 | https://github.com/RossMeikleham/PlutoBoy -------------------------------------------------------------------------------- /gameboy/core/bits.h: -------------------------------------------------------------------------------- 1 | #ifndef BITS_H 2 | #define BITS_H 3 | 4 | // Helper header for bit operations 5 | 6 | #define BIT_0 0x1 7 | #define BIT_1 0x2 8 | #define BIT_2 0x4 9 | #define BIT_3 0x8 10 | #define BIT_4 0x10 11 | #define BIT_5 0x20 12 | #define BIT_6 0x40 13 | #define BIT_7 0x80 14 | 15 | // Given bit 0-7 works out 8 bit value for it 16 | #define BIT(n) (0x1 << n) 17 | 18 | #endif //BITS_H 19 | -------------------------------------------------------------------------------- /gameboy/core/cpu.h: -------------------------------------------------------------------------------- 1 | /* Ross Meikleham 2014*/ 2 | #ifndef CPU_H 3 | #define CPU_H 4 | 5 | #include 6 | 7 | extern int halted; 8 | extern int stopped; 9 | 10 | /* Call interrupt handler code */ 11 | void restart(uint8_t addr); 12 | 13 | 14 | void update_all_cycles(long cycles); 15 | 16 | /* Check if master interrupts are enabled */ 17 | int master_interrupts_enabled(void); 18 | void master_interrupts_disable(void); 19 | void master_interrupts_enable(void); 20 | 21 | 22 | void reset_cpu(void); 23 | 24 | 25 | /* Executes current instruction and returns 26 | * the number of machine cycles it took */ 27 | int exec_opcode(int skip_bug); 28 | 29 | 30 | void print_regs(void); 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /gameboy/core/disasm.h: -------------------------------------------------------------------------------- 1 | #ifndef DISASM_H 2 | #define DISASM_H 3 | 4 | #include 5 | 6 | /* Send to specified stream the opcode of the instruction 7 | * at the specified memory location*/ 8 | void dasm_instruction(uint16_t mem, FILE const *stream); 9 | 10 | #endif //DISASM_H 11 | -------------------------------------------------------------------------------- /gameboy/core/emu.h: -------------------------------------------------------------------------------- 1 | #ifndef EMU_H 2 | #define EMU_H 3 | 4 | #include "serial_io.h" 5 | 6 | /* Intialize emulator with given ROM file, and 7 | * specify whether or not debug mode is active 8 | * (0 for OFF, any other value is on) 9 | * 10 | * returns 1 if successfully initialized, 0 11 | * otherwise */ 12 | int init_emu(const char *file_path, int debugger, int dmg_mode, ClientOrServer cs); 13 | 14 | // Free up all resources, preparing to exit 15 | void finalize_emu(void); 16 | 17 | // Execute until a single frame has been rendered 18 | void run_one_frame(void); 19 | 20 | //Main Fetch-Decode-Execute loop 21 | void run(void); 22 | 23 | 24 | void add_current_cycles(unsigned cycles); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /gameboy/core/graphics.h: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHICS_H 2 | #define GRAPHICS_H 3 | 4 | extern int frame_drawn; // Determines if a frame has been drawn 5 | 6 | /* Initialize graphics 7 | * returns 1 if successful, 0 otherwise */ 8 | int init_gfx(void); 9 | 10 | //Render the row number stored in the LY register 11 | void draw_row(void); 12 | 13 | void output_screen(void); 14 | 15 | 16 | #endif /* GRAPHICS_H */ 17 | 18 | -------------------------------------------------------------------------------- /gameboy/core/interrupts.h: -------------------------------------------------------------------------------- 1 | #ifndef INTERRUPTS_H 2 | #define INTERRUPTS_H 3 | 4 | typedef enum { VBLANK_INT = 0, LCD_INT = 1, TIMER_INT = 2, IO_INT = 3, JOYPAD_INT = 4 } InterruptCode; 5 | 6 | /* Given an interrupt code, raises the interrupt. 7 | * does nothing if interrupt code supplied is invalid */ 8 | void raise_interrupt(InterruptCode ic); 9 | 10 | /* Check if any interrupts have been raised 11 | * and call the appropriate Interrupt Routine if appropriate. 12 | * Returns 1 if the HALT is triggered, 0 otherwise*/ 13 | int handle_interrupts(void); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /gameboy/core/lcd.h: -------------------------------------------------------------------------------- 1 | #ifndef LCD_H 2 | #define LCD_H 3 | 4 | #include "lcd.h" 5 | #include "timers.h" 6 | #include "mmu/memory.h" 7 | #include "memory_layout.h" 8 | #include "interrupts.h" 9 | #include "graphics.h" 10 | #include "bits.h" 11 | #include 12 | #include "cpu.h" 13 | 14 | /* Given the elapsed cpu cycles since the last 15 | * call to this function, updates the internal LCD 16 | * modes, registers and if a Vertical Blank occurs redisplays 17 | * the screen, returns amount of new cycles */ 18 | long update_graphics(long cycles); 19 | 20 | void reset_window_line(void); 21 | 22 | void enable_screen(void); 23 | 24 | void disable_screen(void); 25 | 26 | uint8_t get_interrupt_signal(void); 27 | 28 | int get_lcd_mode(void); 29 | 30 | void set_interrupt_signal(uint8_t s); 31 | 32 | void check_lcd_coincidence(void); 33 | 34 | int screen_enabled(void); 35 | 36 | int lcd_vblank_mode(void); 37 | 38 | int lcd_hblank_mode(void); 39 | 40 | #endif //LCD_H 41 | -------------------------------------------------------------------------------- /gameboy/core/mmu/hdma.h: -------------------------------------------------------------------------------- 1 | #ifndef HDMA_H 2 | #define HDMA_H 3 | 4 | extern int hdma_in_progress; 5 | extern int gdma_in_progress; 6 | extern int bytes_transferred; // no of bytes transferred in current dma 7 | extern uint16_t hdma_source; 8 | extern uint16_t hdma_dest; 9 | extern uint16_t hdma_bytes; 10 | 11 | 12 | void check_cgb_dma(uint8_t value); 13 | 14 | long perform_hdma(void); 15 | 16 | void perform_gdma(uint8_t value); 17 | 18 | #endif //HDMA_H 19 | -------------------------------------------------------------------------------- /gameboy/core/mmu/huc1.h: -------------------------------------------------------------------------------- 1 | #ifndef HUC1_H 2 | #define HUC1_H 3 | 4 | 5 | void setup_HUC1(int flags); 6 | uint8_t read_HUC1(uint16_t addr); 7 | void write_HUC1(uint16_t addr, uint8_t val); 8 | 9 | #endif //HUC1_H 10 | -------------------------------------------------------------------------------- /gameboy/core/mmu/huc3.h: -------------------------------------------------------------------------------- 1 | #ifndef HUC3_H 2 | #define HUC3_H 3 | 4 | 5 | void setup_HUC3(int flags); 6 | uint8_t read_HUC3(uint16_t addr); 7 | void write_HUC3(uint16_t addr, uint8_t val); 8 | 9 | #endif //HUC3_H 10 | -------------------------------------------------------------------------------- /gameboy/core/mmu/mbc.h: -------------------------------------------------------------------------------- 1 | #ifndef MBC_H 2 | #define MBC_H 3 | 4 | #include 5 | 6 | #define RAM_BANK_SIZE 0x2000 // 8KB 7 | #define ROM_BANK_SIZE 0x4000 // 16KB 8 | 9 | extern uint8_t *RAM_banks;//[][0x2000]; // max 16 * 8KB ram banks (128KB) 0x2000 10 | extern uint8_t *ROM_banks;//[][0x4000];// max 512 * 16KB rom banks (8MB) 0x4000 11 | 12 | extern unsigned RAM_bank_count; 13 | 14 | typedef enum {SRAM = 0x1, BATTERY = 0x2, RTC = 0x4, RUMBLE = 0x8, ACCELEROMETER = 0x10} features; 15 | 16 | // Real time clock registers for MBC3 17 | typedef struct { 18 | uint8_t seconds; //0 - 59 19 | uint8_t minutes; //0 - 59 20 | uint8_t hours; //0 - 23 21 | uint8_t days_low; // lower 8 bit of days 22 | uint8_t flags; // upper bit of days + overflow and halt bits 23 | // bit 0 contains 9th bit of days, 24 | // bit 6 contains halt flag 25 | // bit 7 day carry overflow 26 | } rtc_regs_MBC3; 27 | 28 | 29 | 30 | /* Setup a memory bank controller for the given 31 | * cartridge type id. Returns 1 if successful, 32 | * 0 if not implemented or invalid. */ 33 | int setup_MBC(int no, unsigned ram_banks, unsigned rom_banks, char const *file_name); 34 | 35 | 36 | // Frees RAM/ROM banks 37 | void teardown_MBC(void); 38 | 39 | 40 | /* Writes/Reads ROM SRAM from file, used for 41 | * save games */ 42 | void write_SRAM(void); 43 | void read_SRAM(void); 44 | 45 | 46 | //Increments the RTC clock in MBC3 47 | void inc_sec_mbc3(void); 48 | 49 | /* Writes/Reads RTC data from file, 50 | used to emulate MBC3 cartridge clock battery 51 | while the game is turned off */ 52 | rtc_regs_MBC3 read_RTC(void); 53 | void write_RTC(rtc_regs_MBC3 rtc_regs); 54 | 55 | 56 | /* Placeholders for write/read function ptrs 57 | * depending on MBC mode */ 58 | typedef uint8_t (*read_MBC_ptr)(uint16_t addr); 59 | typedef void (*write_MBC_ptr)(uint16_t addr, uint8_t val); 60 | 61 | extern read_MBC_ptr read_MBC; 62 | extern write_MBC_ptr write_MBC; 63 | 64 | 65 | #endif //MBC_H 66 | -------------------------------------------------------------------------------- /gameboy/core/mmu/mbc0.c: -------------------------------------------------------------------------------- 1 | #include "mbc.h" 2 | #include "memory.h" 3 | #include "mbc0.h" 4 | 5 | /* MEMORY BANK CONTROLLER 0 6 | * 7 | * For 32kb roms, maps: 8 | * bank 0 to memory locations 0x0000 - 0x3FFF 9 | * bank 1 to memory locations 0x4000 - 0x7FFF 10 | * 11 | * Writing to any of the two banks has no effect. 12 | * */ 13 | 14 | uint8_t read_MBC0(uint16_t addr) { 15 | 16 | if (addr <= 0x8000) { 17 | return ROM_banks[addr]; 18 | } 19 | 20 | return 0x0; 21 | } 22 | 23 | 24 | void write_MBC0(uint16_t addr __attribute__ ((unused)), uint8_t val __attribute__ ((unused))) { 25 | return; 26 | } 27 | -------------------------------------------------------------------------------- /gameboy/core/mmu/mbc0.h: -------------------------------------------------------------------------------- 1 | #ifndef MBC_0 2 | #define MBC_0 3 | 4 | 5 | uint8_t read_MBC0(uint16_t addr); 6 | void write_MBC0(uint16_t addr, uint8_t val); 7 | 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /gameboy/core/mmu/mbc1.h: -------------------------------------------------------------------------------- 1 | #ifndef MBC1_H 2 | #define MBC1_H 3 | 4 | 5 | void setup_MBC1(int flags); 6 | 7 | uint8_t read_MBC1(uint16_t addr); 8 | void write_MBC1(uint16_t addr, uint8_t val); 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /gameboy/core/mmu/mbc2.h: -------------------------------------------------------------------------------- 1 | #ifndef MBC2_H 2 | #define MBC2_H 3 | 4 | 5 | void setup_MBC2(int flags); 6 | 7 | uint8_t read_MBC2(uint16_t addr); 8 | void write_MBC2(uint16_t addr, uint8_t val); 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /gameboy/core/mmu/mbc3.h: -------------------------------------------------------------------------------- 1 | #ifndef MBC3_H 2 | #define MBC3_H 3 | 4 | void set_rtc_MBC3(void); 5 | void write_rtc_MBC3(void); 6 | 7 | void inc_rtc_second(void); 8 | 9 | void setup_MBC3(int flags); 10 | uint8_t read_MBC3(uint16_t addr); 11 | void write_MBC3(uint16_t addr, uint8_t val); 12 | 13 | #endif //MBC3_H 14 | -------------------------------------------------------------------------------- /gameboy/core/mmu/mbc5.h: -------------------------------------------------------------------------------- 1 | #ifndef MBC5_H 2 | #define MBC5_H 3 | 4 | 5 | void setup_MBC5(int flags); 6 | uint8_t read_MBC5(uint16_t addr); 7 | void write_MBC5(uint16_t addr, uint8_t val); 8 | 9 | #endif //MBC5_H 10 | -------------------------------------------------------------------------------- /gameboy/core/mmu/mmm01.h: -------------------------------------------------------------------------------- 1 | #ifndef MMM01_H 2 | #define MMM01_H 3 | 4 | 5 | void setup_MMM01(int flags); 6 | uint8_t read_MMM01(uint16_t addr); 7 | void write_MMM01(uint16_t addr, uint8_t val); 8 | 9 | #endif //MMM01_H 10 | -------------------------------------------------------------------------------- /gameboy/core/serial_io.h: -------------------------------------------------------------------------------- 1 | // Handles Serial IO Transfers 2 | // i.e. transfers through the GB link cable port 3 | #ifndef SERIAL_IO_H 4 | #define SERIAL_IO_H 5 | 6 | #include 7 | 8 | typedef enum {CLIENT = 0, SERVER = 1, NO_CONNECT = 2} ClientOrServer; 9 | 10 | 11 | int setup_serial_io(ClientOrServer cs, unsigned port); 12 | 13 | /* Start a serial transfer, given then control signals 14 | * and byte of data to send, as well as a pointer of 15 | * where to store a recieved byte */ 16 | void start_transfer(uint8_t *control, uint8_t *data); 17 | 18 | /* Add cycles to the serial transfer, 19 | * used to ensure when using internal clock, 20 | * data is transfered at the correct clock speed */ 21 | void inc_serial_cycles(unsigned cycles); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /gameboy/core/sound.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void sound_add_cycles(unsigned cycles); 8 | 9 | void init_apu(void); 10 | 11 | void write_apu(uint16_t addr, uint8_t val); 12 | 13 | uint8_t read_apu(uint16_t addr); 14 | 15 | void end_frame(void); 16 | 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /gameboy/core/sprite_priorities.h: -------------------------------------------------------------------------------- 1 | #ifndef SPRITE_PRIOS_H 2 | #define SPRITE_PRIOS_H 3 | 4 | #include 5 | 6 | #define MAX_SPRITES 40 7 | 8 | typedef struct node Node; 9 | 10 | typedef struct sprite_iterator { 11 | Node *next; 12 | } Sprite_Iterator; 13 | 14 | void init_sprite_prio_list(void); 15 | 16 | /* Given the sprite number and its new starting x position 17 | * reorders the given sprite's priority */ 18 | void update_sprite_prios(int sprite_no, uint8_t x_pos); 19 | 20 | Sprite_Iterator create_sprite_iterator(void); 21 | int sprite_iterator_next(Sprite_Iterator *si); 22 | #endif //SPRITE_PRIOS_H 23 | 24 | -------------------------------------------------------------------------------- /gameboy/core/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef TIMERS_H 2 | #define TIMERS_H 3 | 4 | #include 5 | #include "bits.h" 6 | #include "mmu/memory.h" 7 | #include "memory_layout.h" 8 | #include 9 | 10 | #define GB_CLOCK_SPEED_HZ 4194304 /* GameBoy Clock speed in HZ */ 11 | #define SGB_CLOCK_SPEED_HZ 4295454 /* Super GameBoy Clock speed in HZ */ 12 | #define CGB_CLOCK_SPEED_HZ 8388000 /* GameBoy Color Clock speed in HZ */ 13 | #define DIV_TIMER_INC_FREQUENCY 16382 14 | 15 | extern int cgb_speed; 16 | 17 | void setup_timers(void); 18 | 19 | /* Set and get the clockspeed in hz */ 20 | void set_clock_speed(long hz); 21 | long get_clock_speed(void); 22 | 23 | void increment_div(void); 24 | 25 | void increment_tima(void); 26 | 27 | /* Change the timer frequency to another of the possible 28 | * frequencies, resets the timer_counter 29 | * If frequency number selected isn't valid then nothing happens*/ 30 | void set_timer_frequency(unsigned int n); 31 | 32 | /* Update internal timers given the cycles executed since 33 | * the last time this function was called. */ 34 | void update_timers(long cycles); 35 | 36 | #endif //TIMERS_H 37 | -------------------------------------------------------------------------------- /gameboy/non_core/debugger.h: -------------------------------------------------------------------------------- 1 | #ifndef DEBUGGER_H 2 | #define DEBUGGER_H 3 | 4 | typedef enum {NONE = 0x0, STEPS_SET = 0x1, BREAKPOINT_SET = 0x2} Command_Flag; 5 | 6 | #define BREAKPOINT_OFF 0x0 7 | #define STEPS_OFF 0x0 8 | 9 | /* Get debugger command(s) and perform a number 10 | * of debugger actions. Returns an integer containing set/unset 11 | * flags specifying the options selected. */ 12 | int get_command(void); 13 | 14 | 15 | /* Get number of steps, 0 or below 16 | * if stepping not occuring */ 17 | long get_steps(void); 18 | 19 | // No longer stepping 20 | void turn_steps_off(void); 21 | 22 | 23 | /* Get 16bit address of breakpoint 24 | * result is below 0 if no breakpoint set */ 25 | long get_breakpoint(void); 26 | 27 | //Disable breakpoint 28 | void turn_breakpoint_off(void); 29 | 30 | 31 | 32 | #endif //DEBUGGER_H 33 | -------------------------------------------------------------------------------- /gameboy/non_core/files.h: -------------------------------------------------------------------------------- 1 | #ifndef FILES_H 2 | #define FILES_H 3 | 4 | #define MAX_FILE_SIZE 0x800000 //8MB Roms 5 | #define MAX_SRAM_SIZE 0x8000 // 128KB SRAM 6 | 7 | /* Given a file_path and buffer to store file data in, attempts to 8 | * read the file into the buffer. Returns the size of the file if successful, 9 | * returns 0 if unsuccessful. Buffer should be at minimum of size "MAX_FILE_SIZE"*/ 10 | unsigned long load_rom_from_file(const char *file_path, unsigned char *data); 11 | 12 | /* Given a file_path and buffer, attempts to load save data into the buffer. 13 | * Returns the size of the file if successful, returns 0 if unsuccessful. 14 | * Buffer should be at minimum of size "MAX_SRAMS_SIZE" */ 15 | unsigned long load_SRAM(const char *file_path, unsigned char *data, unsigned long size); 16 | 17 | 18 | /* Given a file_path, save data and the size of save data, attempts to 19 | * save the data to the given file. Returns 1 if successful, 0 otherwise */ 20 | int save_SRAM(const char *file_path, const unsigned char *data, unsigned long size); 21 | 22 | #endif //FILES_H 23 | -------------------------------------------------------------------------------- /gameboy/non_core/framerate.h: -------------------------------------------------------------------------------- 1 | #ifndef FRAMERATE_H 2 | #define FRAMERATE_H 3 | 4 | #define DEFAULT_FPS 60 5 | 6 | extern int limiter; // FPS limiter ON or OFF 7 | 8 | //Set a framerate and start the counter 9 | void start_framerate(int fps); 10 | 11 | 12 | /*Adjusts speed of game to the current framerate 13 | *by sleeping for the required time*/ 14 | void adjust_to_framerate(void); 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /gameboy/non_core/get_time.h: -------------------------------------------------------------------------------- 1 | #ifndef GET_TIME_H 2 | #define GET_TIME_H 3 | 4 | #include 5 | 6 | // Returns time in miliseconds since Unix Epoch 7 | //uint64_t get_time(); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /gameboy/non_core/graphics_out.h: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHICS_OUT 2 | #define GRAPHICS_OUT 3 | 4 | #define GB_PIXELS_X 160 //Gameboy Pixel dimensions 5 | #define GB_PIXELS_Y 144 6 | 7 | #include 8 | 9 | /* Initialise graphics and create win_x by win_y pixel 10 | * screen. Keeps track of GB_PIXELS_Y by GB_PIXELS_X screen. 11 | * return 1 if successful, 0 otherwise */ 12 | int init_screen(int win_x, int win_y, uint32_t *pixels); 13 | 14 | /* Update the screen output*/ 15 | void draw_screen(void); 16 | 17 | void cleanup_graphics_out(void); 18 | #endif 19 | -------------------------------------------------------------------------------- /gameboy/non_core/logger.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGGER_H 2 | #define LOGGER_H 3 | 4 | #ifdef __cplusplus 5 | extern "C"{ 6 | #endif 7 | 8 | // Different Logging levels 9 | typedef enum {LOG_INFO = 0, LOG_WARN = 1, LOG_ERROR = 2, LOG_OFF = 3} LogLevel; 10 | 11 | // Set one of the 4 specified logging levels 12 | void set_log_level(LogLevel ll); 13 | 14 | /* Log a given message with the specified logging level, 15 | * if the current logging level set it greater than or equal 16 | * to the level supplied (and neither are OFF) then the message 17 | * will be successfully logged. */ 18 | void log_message(LogLevel ll, const char *fmt, ...); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif //LOGGER_H 25 | -------------------------------------------------------------------------------- /gameboy/non_core/serial_io_transfer.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | int setup_client(unsigned port); 5 | int setup_server(unsigned port); 6 | 7 | uint8_t transfer_int(uint8_t data); 8 | int transfer_ext(uint8_t data, uint8_t *recv); 9 | -------------------------------------------------------------------------------- /gameboy/platforms/debugger.c: -------------------------------------------------------------------------------- 1 | #include "../non_core/debugger.h" 2 | 3 | #include "../core/mmu/memory.h" 4 | #include "../core/disasm.h" 5 | #include "../core/cpu.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /* Get debugger command(s) and perform a number 13 | * of debugger actions. Returns an integer containing set/unset 14 | * flags specifying the options selected. */ 15 | int get_command() { 16 | return 0; 17 | } 18 | 19 | /* Get number of steps, 0 or below 20 | * if stepping not occuring */ 21 | long get_steps() { 22 | return 0; 23 | } 24 | 25 | // No longer stepping 26 | void turn_steps_off() { 27 | } 28 | 29 | /* Get 16bit address of breakpoint 30 | * result is below 0 if no breakpoint set */ 31 | long get_breakpoint() { 32 | return 0; 33 | } 34 | 35 | //Disable breakpoint 36 | void turn_breakpoint_off() { 37 | } 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /gameboy/platforms/libs.c: -------------------------------------------------------------------------------- 1 | #include "libs.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | /* 13 | void *uefi_fopen(const char * const path, 14 | const char * const access __attribute__ ((unused))) { 15 | 16 | grub_file_t *file = NULL; 17 | 18 | *file = grub_file_open (path, GRUB_FILE_TYPE_CAT); 19 | 20 | if (!*file) 21 | { 22 | grub_printf ("Error opening file %s\n", path); 23 | return 0; 24 | } 25 | 26 | return file; 27 | } 28 | 29 | int uefi_fseek(void *stream, long int offset, int origin __attribute__ ((unused))) { 30 | grub_file_t* file = (grub_file_t *)stream; 31 | int res = grub_file_seek (*file, offset); 32 | return res; 33 | } 34 | 35 | size_t uefi_fread(void *ptr, size_t size, size_t count, void *stream) { 36 | grub_file_t* file = (grub_file_t *)stream; 37 | grub_file_read (*file, ptr, size * count); 38 | return count; 39 | } 40 | 41 | void uefi_fclose(void *stream) { 42 | grub_file_t* file = (grub_file_t *)stream; 43 | grub_file_close (*file); 44 | } 45 | */ 46 | char *uefi_strncpy(char *dest, const char * const src, size_t len) { 47 | return grub_strncpy (dest, src, len); 48 | } 49 | 50 | char *uefi_strcat(char *dest, const char * const src) { 51 | return grub_strcat (dest, src); 52 | } 53 | 54 | void *uefi_memmove(void *dst, const void *src, size_t len) { 55 | return grub_memmove (dst, src, len); 56 | } 57 | -------------------------------------------------------------------------------- /gameboy/platforms/libs.h: -------------------------------------------------------------------------------- 1 | #ifndef UEFI_LIBS 2 | #define UEFI_LIBS 3 | 4 | #include 5 | 6 | // Custom horribly implemented libC functions, which aren't present/won't link 7 | // in EDK2 8 | 9 | #include 10 | /* 11 | void *uefi_fopen(const char * const path, const char * const access); 12 | 13 | int uefi_fseek(void *stream, long int offset, int origin); 14 | 15 | size_t uefi_fread(void *ptr, size_t size, size_t count, void *stream); 16 | 17 | void uefi_fclose(void *stream); 18 | */ 19 | char *uefi_strncpy(char *dest, const char * const src, size_t len); 20 | 21 | char *uefi_strcat(char *dest, const char * const src); 22 | 23 | void *uefi_memmove(void *dst, const void *src, size_t len); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /gameboy/platforms/main.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | UEFI Plutoboy entry point 3 | **/ 4 | 5 | #include "../non_core/logger.h" 6 | #include "../core/mmu/memory.h" 7 | #include "../core/emu.h" 8 | 9 | #include "../core/serial_io.h" 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | GRUB_MOD_LICENSE ("GPLv3+"); 26 | 27 | static grub_err_t 28 | grub_cmd_gameboy (grub_extcmd_context_t ctxt __attribute__ ((unused)), 29 | int argc, char **args) 30 | { 31 | 32 | if (argc < 1) { 33 | grub_printf ("Usage: gameboy ROM_FILE\n"); 34 | return 1; 35 | } 36 | 37 | char *file_name = args[0]; 38 | 39 | int debug = 0; 40 | int dmg_mode = 0; 41 | 42 | ClientOrServer cs = NO_CONNECT; 43 | 44 | if (!init_emu(file_name, debug, dmg_mode, cs)) { 45 | grub_printf ("Failed to init emulator\n"); 46 | log_message(LOG_ERROR, "failed to load file\n"); 47 | return 1; 48 | } 49 | log_message(LOG_INFO, "exiting\n"); 50 | run(); 51 | return 0; 52 | } 53 | 54 | static grub_extcmd_t cmd; 55 | 56 | GRUB_MOD_INIT(gameboy) 57 | { 58 | cmd = grub_register_extcmd ("gameboy", grub_cmd_gameboy, 0, N_("FILE"), 59 | N_("UEFI gameboy emulator."), NULL); 60 | } 61 | 62 | GRUB_MOD_FINI(gameboy) 63 | { 64 | grub_unregister_extcmd (cmd); 65 | } -------------------------------------------------------------------------------- /gameboy/platforms/time.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/gameboy/platforms/time.h -------------------------------------------------------------------------------- /gameboy/shared_libs/framerate.c: -------------------------------------------------------------------------------- 1 | #include "../non_core/framerate.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | static uint64_t last_ticks; 13 | static int framerate; 14 | static int count; 15 | static uint64_t current_ticks = 0; 16 | 17 | static uint64_t get_timestamp_micro(void) { 18 | return 0; 19 | } 20 | 21 | //Assign Framerate in FPS and start counter 22 | void start_framerate(int f) { 23 | last_ticks = get_timestamp_micro(); 24 | framerate = f; 25 | count = 0; 26 | } 27 | 28 | /* Check time elapsed after one frame, hold up 29 | * the program if not enough tim has elapsed */ 30 | void adjust_to_framerate() { 31 | current_ticks = get_timestamp_micro(); 32 | uint64_t ticks_elapsed = current_ticks - last_ticks; 33 | 34 | // Running on Bare Metal, just delay for the required cycles 35 | grub_efi_boot_services_t *b; 36 | b = grub_efi_system_table->boot_services; 37 | efi_call_1 (b->stall, (grub_efi_uintn_t)(1000000/framerate - ticks_elapsed)); 38 | 39 | current_ticks = get_timestamp_micro(); 40 | 41 | count = (count + 1) % 60; 42 | 43 | last_ticks = current_ticks; 44 | } 45 | -------------------------------------------------------------------------------- /gameboy/shared_libs/serial_io.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "../non_core/serial_io_transfer.h" 5 | #include "../non_core/logger.h" 6 | 7 | /* Setup TCP Client, and attempt to connect 8 | * to the server */ 9 | int setup_client(unsigned port __attribute__ ((unused))) { 10 | return 0; 11 | } 12 | 13 | /* Setup TCP Server, and wait for a single 14 | * client to connect */ 15 | int setup_server(unsigned port __attribute__ ((unused))) { 16 | return 0; 17 | } 18 | 19 | /* Send and Recieved byte 20 | int transfer(uint8_t data __attribute__ ((unused)), uint8_t *recv __attribute__ ((unused)), int ext __attribute__ ((unused))) { 21 | return 0; 22 | } 23 | 24 | 25 | void quit_io(void) { 26 | }*/ 27 | 28 | 29 | // Transfer when current GB is using external clock 30 | // returns 1 if there is data to be recieved, 0 otherwise 31 | int transfer_ext(uint8_t data __attribute__ ((unused)), uint8_t *recv __attribute__ ((unused))) { 32 | return 0; 33 | } 34 | 35 | // Transfer when current GB is using internal clock 36 | // returns 0xFF if no external GB found 37 | uint8_t transfer_int(uint8_t data __attribute__ ((unused))) { 38 | return 0xFF; 39 | } 40 | -------------------------------------------------------------------------------- /gameboy/shared_libs/sound.c: -------------------------------------------------------------------------------- 1 | #include "../core/sound.h" 2 | 3 | // UEFI doesn't have any sound support, just stub everything out 4 | 5 | 6 | void init_apu() { 7 | } 8 | 9 | void sound_add_cycles(unsigned c __attribute__ ((unused))) { 10 | } 11 | 12 | void write_apu(uint16_t addr __attribute__ ((unused)), uint8_t val __attribute__ ((unused))) { 13 | } 14 | 15 | uint8_t read_apu(uint16_t addr __attribute__ ((unused))) { 16 | return 0xFF; 17 | } 18 | 19 | void end_frame() { 20 | } 21 | -------------------------------------------------------------------------------- /goprotate/GopRotate.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a1ive/grub-extras/3c0cc890d9b810918d8e814a162ec143084608fe/goprotate/GopRotate.efi -------------------------------------------------------------------------------- /goprotate/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = goprotate; 5 | common = contrib/goprotate/goprotate.c; 6 | enable = efi; 7 | }; 8 | -------------------------------------------------------------------------------- /hello/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = hello; 5 | common = contrib/hello/hello.c; 6 | }; 7 | -------------------------------------------------------------------------------- /hello/hello.c: -------------------------------------------------------------------------------- 1 | /* hello.c - test module for dynamic loading */ 2 | /* 3 | * GRUB -- GRand Unified Bootloader 4 | * Copyright (C) 2003,2007 Free Software Foundation, Inc. 5 | * Copyright (C) 2003 NIIBE Yutaka 6 | * 7 | * GRUB is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * GRUB is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GRUB. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | GRUB_MOD_LICENSE ("GPLv3+"); 30 | 31 | static grub_err_t 32 | grub_cmd_hello (grub_extcmd_context_t ctxt __attribute__ ((unused)), 33 | int argc __attribute__ ((unused)), 34 | char **args __attribute__ ((unused))) 35 | { 36 | grub_printf ("%s\n", _("Hello World")); 37 | return 0; 38 | } 39 | 40 | static grub_extcmd_t cmd; 41 | 42 | GRUB_MOD_INIT(hello) 43 | { 44 | cmd = grub_register_extcmd ("hello", grub_cmd_hello, 0, 0, 45 | N_("Say `Hello World'."), 0); 46 | } 47 | 48 | GRUB_MOD_FINI(hello) 49 | { 50 | grub_unregister_extcmd (cmd); 51 | } 52 | -------------------------------------------------------------------------------- /hwmatch/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = hwmatch; 5 | i386_pc = contrib/hwmatch/hwmatch.c; 6 | enable = i386_pc; 7 | cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)'; 8 | cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)'; 9 | }; -------------------------------------------------------------------------------- /ntldr-img/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | .deps-util 5 | .deps-core 6 | .dirstamp 7 | Makefile.core.am 8 | -------------------------------------------------------------------------------- /ntldr-img/Makefile.core.common: -------------------------------------------------------------------------------- 1 | if COND_i386_pc 2 | # Compatibility symlink. 3 | g2hdr.bin: g2hdr.img 4 | rm -f $@ 5 | $(LN_S) $< $@ 6 | platform_DATA += g2hdr.bin 7 | CLEANFILES += g2hdr.bin 8 | 9 | g2ldr.mbr: g2ldr.img 10 | head -c 8192 $< > $@ 11 | platform_DATA += g2ldr.mbr 12 | CLEANFILES += g2ldr.mbr 13 | 14 | grldr.mbr: grldr.img 15 | head -c 8192 $< > $@ 16 | CLEANFILES += grldr.mbr 17 | 18 | bin2h: contrib/ntldr-img/bin2h.c 19 | $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $^ -o $@ 20 | CLEANFILES += bin2h 21 | 22 | grub_mbr.h: grldr.mbr bin2h 23 | ./bin2h grub_mbr 8192 < $< > $@ 24 | CLEANFILES += grub_mbr.h 25 | 26 | grub-ntldr-img$(EXEEXT): contrib/ntldr-img/grubinst.c contrib/ntldr-img/utils.c grub_mbr.h 27 | $(HOST_CC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(HOST_LDFLAGS) -DGRUB_UTIL=1 -I. -I$(srcdir)/contrib/ntldr-img -DLINUX -o $@ $(srcdir)/contrib/ntldr-img/grubinst.c $(srcdir)/contrib/ntldr-img/utils.c 28 | bin_PROGRAMS += grub-ntldr-img 29 | CLEANFILES += grub-ntldr-img 30 | 31 | # Compatibility symlink. 32 | grubinst$(EXEEXT): grub-ntldr-img$(EXEEXT) 33 | rm -f $@ 34 | $(LN_S) $< $@ 35 | noinst_PROGRAMS += grubinst 36 | CLEANFILES += grubinst 37 | 38 | endif 39 | -------------------------------------------------------------------------------- /ntldr-img/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | image = { 4 | name = g2hdr; 5 | i386_pc = contrib/ntldr-img/g2hdr.S; 6 | i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)'; 7 | i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x0'; 8 | objcopyflags = '-O binary'; 9 | enable = i386_pc; 10 | }; 11 | 12 | image = { 13 | name = grldr; 14 | i386_pc = contrib/ntldr-img/grldrstart.S; 15 | i386_pc = contrib/ntldr-img/ntfsbs.S; 16 | i386_pc_ccasflags = -DGRLDR_MBR; 17 | i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)'; 18 | i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7c00'; 19 | objcopyflags = '-O binary'; 20 | enable = i386_pc; 21 | }; 22 | 23 | image = { 24 | name = g2ldr; 25 | i386_pc = contrib/ntldr-img/grldrstart.S; 26 | i386_pc = contrib/ntldr-img/ntfsbs.S; 27 | i386_pc_ccasflags = '-DGRLDR_MBR -DBOOTGRUB2'; 28 | i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)'; 29 | i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7c00'; 30 | objcopyflags = '-O binary'; 31 | enable = i386_pc; 32 | }; 33 | -------------------------------------------------------------------------------- /ntldr-img/README: -------------------------------------------------------------------------------- 1 | 2 | grub-extras is meant to be used as an overlay on grub2 source tree. 3 | 4 | Build instructions: 5 | 6 | - Copy grub-extras in a subdirectory of your grub2 checkout. 7 | For example, "grub-extras". 8 | 9 | - Export GRUB_CONTRIB environment variable to point to this directory. 10 | 11 | - Build GRUB as usual. 12 | -------------------------------------------------------------------------------- /ntldr-img/bin2h.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Robert Millan 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | int 22 | main (int argc, char *argv[]) 23 | { 24 | int b, i; 25 | char *sym; 26 | unsigned int len; 27 | 28 | if (argc != 3) 29 | { 30 | fprintf (stderr, "Usage: %s symbol_name length\n", argv[0]); 31 | exit (1); 32 | } 33 | 34 | sym = argv[1]; 35 | len = atoi (argv[2]); 36 | 37 | b = getchar (); 38 | if (b == EOF) 39 | goto abort; 40 | 41 | printf ("/* THIS CHUNK OF BYTES IS AUTOMATICALY GENERATED */\n" 42 | "unsigned char %s[%u] =\n{\n", sym, len); 43 | 44 | while (1) 45 | { 46 | printf ("0x%02x", b); 47 | 48 | b = getchar (); 49 | if (b == EOF) 50 | goto end; 51 | 52 | for (i = 0; i < 16 - 1; i++) 53 | { 54 | printf (", 0x%02x", b); 55 | 56 | b = getchar (); 57 | if (b == EOF) 58 | goto end; 59 | } 60 | 61 | printf (",\n"); 62 | } 63 | 64 | end: 65 | printf ("\n};\n"); 66 | 67 | abort: 68 | exit (0); 69 | } 70 | -------------------------------------------------------------------------------- /ntldr-img/version.h: -------------------------------------------------------------------------------- 1 | #define VERSION "1.1" 2 | #define VER_MAJOR 1 3 | #define VER_MINOR 1 4 | -------------------------------------------------------------------------------- /peinfo/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = peinfo; 5 | common = contrib/peinfo/peinfo.c; 6 | cflags = '$(CFLAGS_POSIX)'; 7 | cppflags = '$(CPPFLAGS_POSIX)'; 8 | }; 9 | -------------------------------------------------------------------------------- /pong/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = pong; 5 | common = contrib/pong/pong.c; 6 | enable = efi; 7 | }; -------------------------------------------------------------------------------- /qrcode/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2010 Psytec Inc. 4 | Copyright (c) 2012 Alexey Mednyy 5 | Copyright (c) 2012-2016 Pavol Rusnak 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. -------------------------------------------------------------------------------- /qrcode/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = qrcode; 5 | common = contrib/qrcode/qrcode.c; 6 | common = contrib/qrcode/qr_encode.c; 7 | cflags = '$(CFLAGS_POSIX)'; 8 | cppflags = '$(CPPFLAGS_POSIX)'; 9 | }; -------------------------------------------------------------------------------- /raiddump/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = raiddump; 5 | common = contrib/raiddump/raiddump.c; 6 | }; 7 | -------------------------------------------------------------------------------- /sokoban/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = sokoban; 5 | common = contrib/sokoban/sokoban.c; 6 | enable = efi; 7 | }; -------------------------------------------------------------------------------- /sokoban/level/1.txt: -------------------------------------------------------------------------------- 1 | |========| 2 | |==###===| 3 | |==#X#===| 4 | |==# ####| 5 | |###O OX#| 6 | |#X O@###| 7 | |####O#==| 8 | |===#X#==| 9 | |===###==| 10 | ||=======| -------------------------------------------------------------------------------- /sokoban/level/10.txt: -------------------------------------------------------------------------------- 1 | |========| 2 | |==######| 3 | |==# #| 4 | |###OOO #| 5 | |#@ OXX #| 6 | |# OXXX##| 7 | |#### #=| 8 | |===####=| 9 | ||=======| -------------------------------------------------------------------------------- /sokoban/level/11.txt: -------------------------------------------------------------------------------- 1 | |============| 2 | |=####==#####| 3 | |## #==# #| 4 | |# O ####O #| 5 | |# OXXXX O #| 6 | |## # @ ##| 7 | |=##########=| 8 | ||===========| -------------------------------------------------------------------------------- /sokoban/level/12.txt: -------------------------------------------------------------------------------- 1 | |========| 2 | |==#####=| 3 | |### @#=| 4 | |# OX ##| 5 | |# XOX #| 6 | |### QO #| 7 | |==# ##| 8 | |==######| 9 | ||=======| -------------------------------------------------------------------------------- /sokoban/level/13.txt: -------------------------------------------------------------------------------- 1 | |========| 2 | |==####==| 3 | |==#XX#==| 4 | |=## X##=| 5 | |=# OX#=| 6 | |## O ##| 7 | |# #OO #| 8 | |# @ #| 9 | |########| 10 | ||=======| -------------------------------------------------------------------------------- /sokoban/level/14.txt: -------------------------------------------------------------------------------- 1 | |========| 2 | |########| 3 | |# # #| 4 | |# OXXO #| 5 | |#@OXQ ##| 6 | |# OXXO #| 7 | |# # #| 8 | |########| 9 | ||=======| -------------------------------------------------------------------------------- /sokoban/level/15.txt: -------------------------------------------------------------------------------- 1 | |========| 2 | |=######=| 3 | |## ##| 4 | |# O OO #| 5 | |#XXXXXX#| 6 | |# OO O #| 7 | |### @###| 8 | |==####==| 9 | ||=======| -------------------------------------------------------------------------------- /sokoban/level/16.txt: -------------------------------------------------------------------------------- 1 | |==========| 2 | |==########| 3 | |==# ###| 4 | |==# O #| 5 | |### O ## #| 6 | |#XXX O #| 7 | |#XXXO#O ##| 8 | |#### # O #| 9 | |===# @ #| 10 | |===#######| 11 | ||=========| -------------------------------------------------------------------------------- /sokoban/level/17.txt: -------------------------------------------------------------------------------- 1 | |=========| 2 | |######===| 3 | |# #===| 4 | |# OOO##==| 5 | |# #XX###| 6 | |## XXO #| 7 | |=# @ #| 8 | |=########| 9 | ||========| -------------------------------------------------------------------------------- /sokoban/level/18.txt: -------------------------------------------------------------------------------- 1 | |==========| 2 | |==########| 3 | |==# #X #| 4 | |=## OXXX#| 5 | |=# O #QX#| 6 | |## ##O# ##| 7 | |# O O #| 8 | |# # #| 9 | |#######@ #| 10 | |======####| 11 | ||=========| -------------------------------------------------------------------------------- /sokoban/level/19.txt: -------------------------------------------------------------------------------- 1 | |==========| 2 | |=#######==| 3 | |=#XXXX #==| 4 | |###XXXO###| 5 | |# O#O O #| 6 | |# OO #O #| 7 | |# # #| 8 | |#### @ ###| 9 | |===#####==| 10 | ||=========| -------------------------------------------------------------------------------- /sokoban/level/2.txt: -------------------------------------------------------------------------------- 1 | |=========| 2 | |#####====| 3 | |#@ #====| 4 | |# OO#=###| 5 | |# O #=#X#| 6 | |### ###X#| 7 | |=## X#| 8 | |=# # #| 9 | |=# ####| 10 | |=#####===| 11 | ||========| -------------------------------------------------------------------------------- /sokoban/level/20.txt: -------------------------------------------------------------------------------- 1 | |=======| 2 | |#######| 3 | |#XXOXX#| 4 | |#XX#XX#| 5 | |# OOO #| 6 | |# O #| 7 | |# OOO #| 8 | |# #@ #| 9 | |#######| 10 | ||======| -------------------------------------------------------------------------------- /sokoban/level/21.txt: -------------------------------------------------------------------------------- 1 | |===========| 2 | |===######==| 3 | |===# XXX#==| 4 | |####XXXX#==| 5 | |# ###O ###| 6 | |# O O OO #| 7 | |#@ O O #| 8 | |# ### #| 9 | |#####=#####| 10 | ||==========| -------------------------------------------------------------------------------- /sokoban/level/22.txt: -------------------------------------------------------------------------------- 1 | |=========| 2 | |########=| 3 | |# #=| 4 | |# #OO #=| 5 | |# XXX# #=| 6 | |##XXXO ##| 7 | |=# ## O #| 8 | |=#O O #| 9 | |=# # @#| 10 | |=########| 11 | ||========| -------------------------------------------------------------------------------- /sokoban/level/23.txt: -------------------------------------------------------------------------------- 1 | |==========| 2 | |==#####===| 3 | |### ####| 4 | |# O O #| 5 | |# O @O #| 6 | |###OO#####| 7 | |==# XX#==| 8 | |==#XXXX#==| 9 | |==######==| 10 | ||=========| -------------------------------------------------------------------------------- /sokoban/level/24.txt: -------------------------------------------------------------------------------- 1 | |==============| 2 | |######===#####| 3 | |# ###=# X#| 4 | |# O O #=#XXX#| 5 | |# # O ### X#| 6 | |# OOO O @X#| 7 | |### O O# X#| 8 | |==# O#O #XXX#| 9 | |==## # X#| 10 | |===###########| 11 | ||=============| -------------------------------------------------------------------------------- /sokoban/level/25.txt: -------------------------------------------------------------------------------- 1 | |===========| 2 | |=====######| 3 | |=#####X #| 4 | |=# #XX## #| 5 | |=# OXX #| 6 | |=# # X# ##| 7 | |### ##O# #| 8 | |# O OO #| 9 | |# #O# # #| 10 | |#@ #######| 11 | |#####======| 12 | ||==========| -------------------------------------------------------------------------------- /sokoban/level/26.txt: -------------------------------------------------------------------------------- 1 | |=============| 2 | |=#########===| 3 | |=# ## ####| 4 | |=# O #| 5 | |=##O### ## #| 6 | |=# ## Q # ##| 7 | |=# OXXXXXX #=| 8 | |## ### X # #=| 9 | |# O###O#=| 10 | |# # O@#=| 11 | |#####O# ####=| 12 | |====# #====| 13 | |====#####====| 14 | ||============| -------------------------------------------------------------------------------- /sokoban/level/27.txt: -------------------------------------------------------------------------------- 1 | |===============| 2 | |======#########| 3 | |======# #| 4 | |======# # # # #| 5 | |======# O O# #| 6 | |####### O #| 7 | |#XX# ## O O# #| 8 | |#XX ## O O #| 9 | |#XX# ## ######| 10 | |#XX# # O O #===| 11 | |#XX O #===| 12 | |# ###@ ###===| 13 | |####=#####=====| 14 | ||==============| -------------------------------------------------------------------------------- /sokoban/level/28.txt: -------------------------------------------------------------------------------- 1 | |=========| 2 | |########=| 3 | |#XXXXXX#=| 4 | |# O # ##| 5 | |# O # O #| 6 | |##O O O #| 7 | |=# @ #| 8 | |=########| 9 | ||========| -------------------------------------------------------------------------------- /sokoban/level/29.txt: -------------------------------------------------------------------------------- 1 | |============| 2 | |==##########| 3 | |### X@ #| 4 | |# ##O## #| 5 | |# Q X X ##| 6 | |## O##O## #=| 7 | |=# X #=| 8 | |=##########=| 9 | ||===========| -------------------------------------------------------------------------------- /sokoban/level/3.txt: -------------------------------------------------------------------------------- 1 | |==========| 2 | |=#######==| 3 | |=# ###| 4 | |##O### #| 5 | |# @ O O #| 6 | |# XX# O ##| 7 | |##XX# #=| 8 | |=########=| 9 | ||=========| -------------------------------------------------------------------------------- /sokoban/level/30.txt: -------------------------------------------------------------------------------- 1 | |=========| 2 | |===######| 3 | |####X @#| 4 | |# OOO #| 5 | |#X##X##X#| 6 | |# O #| 7 | |# OX# ##| 8 | |#### #=| 9 | |===#####=| 10 | ||========| -------------------------------------------------------------------------------- /sokoban/level/31.txt: -------------------------------------------------------------------------------- 1 | |==========| 2 | |#########=| 3 | |# ## #=| 4 | |# # O O #=| 5 | |# QX# #=| 6 | |## #X@X##=| 7 | |##O###Q###| 8 | |# #| 9 | |# ## # #| 10 | |###### #| 11 | |=====#####| 12 | ||=========| -------------------------------------------------------------------------------- /sokoban/level/32.txt: -------------------------------------------------------------------------------- 1 | |========| 2 | |=######=| 3 | |=#X XX#=| 4 | |=#X OX#=| 5 | |### O##| 6 | |# O O #| 7 | |# #O## #| 8 | |# @ #| 9 | |########| 10 | ||=======| -------------------------------------------------------------------------------- /sokoban/level/33.txt: -------------------------------------------------------------------------------- 1 | |==============| 2 | |====######====| 3 | |==### ###==| 4 | |==# #O ###| 5 | |==# O OO #| 6 | |==# OO #O #| 7 | |==## O O #| 8 | |###### #O#####| 9 | |#XX@ #O #====| 10 | |#X#XX O##====| 11 | |#XXXXO# #=====| 12 | |#XXXX #=====| 13 | |#########=====| 14 | ||=============| -------------------------------------------------------------------------------- /sokoban/level/34.txt: -------------------------------------------------------------------------------- 1 | |=======| 2 | |#######| 3 | |# # #| 4 | |# # #| 5 | |# OO #| 6 | |#@ XO##| 7 | |###XX#=| 8 | |==####=| 9 | ||======| -------------------------------------------------------------------------------- /sokoban/level/4.txt: -------------------------------------------------------------------------------- 1 | |======| 2 | |=####=| 3 | |## #=| 4 | |#@O #=| 5 | |##O ##| 6 | |## O #| 7 | |#XO #| 8 | |#XXQX#| 9 | |######| 10 | ||=====| -------------------------------------------------------------------------------- /sokoban/level/5.txt: -------------------------------------------------------------------------------- 1 | |========| 2 | |=#####==| 3 | |=# @###=| 4 | |=# O #=| 5 | |### # ##| 6 | |#X# # #| 7 | |#XO # #| 8 | |#X O #| 9 | |########| 10 | ||=======| -------------------------------------------------------------------------------- /sokoban/level/6.txt: -------------------------------------------------------------------------------- 1 | |=============| 2 | |===#######===| 3 | |#### #===| 4 | |# X### #===| 5 | |# # # ##==| 6 | |# # O O#X #==| 7 | |# # Q # #==| 8 | |# X#O O # #==| 9 | |## # # ###| 10 | |=# ###X @#| 11 | |=# ## #| 12 | |=############| 13 | ||============| -------------------------------------------------------------------------------- /sokoban/level/7.txt: -------------------------------------------------------------------------------- 1 | |==========| 2 | |===#######| 3 | |==## # @#| 4 | |==# #O #| 5 | |==#O O #| 6 | |==# O## #| 7 | |### O # ##| 8 | |#XXXXX #=| 9 | |#########=| 10 | ||=========| -------------------------------------------------------------------------------- /sokoban/level/8.txt: -------------------------------------------------------------------------------- 1 | |==========| 2 | |===######=| 3 | |=### #=| 4 | |##X O## ##| 5 | |#XXO O @ #| 6 | |#XX O O ##| 7 | |###### #=| 8 | |=====####=| 9 | ||=========| -------------------------------------------------------------------------------- /sokoban/level/9.txt: -------------------------------------------------------------------------------- 1 | |===========| 2 | |=#########=| 3 | |=# ## #=| 4 | |=# O #=| 5 | |=#O ### O#=| 6 | |=# #XXX# #=| 7 | |## #XXX# ##| 8 | |# O O O #| 9 | |# # @#| 10 | |###########| 11 | ||==========| -------------------------------------------------------------------------------- /vdisk/Makefile.core.def: -------------------------------------------------------------------------------- 1 | AutoGen definitions Makefile.tpl; 2 | 3 | module = { 4 | name = vdisk; 5 | common = contrib/vdisk/vdiskctl.c; 6 | common = contrib/vdisk/vdisk.c; 7 | common = contrib/vdisk/vfs.c; 8 | }; --------------------------------------------------------------------------------