├── scripts ├── process_wrapper_gdb.cmds ├── test.bsh ├── Makefile ├── process_wrapper.sh ├── setup_env.sh ├── process_wrapper_gdb.sh └── boot_script.bsh ├── commands ├── Makefile ├── bomber │ ├── Manifest.xml │ ├── Jamfile │ └── bomb_host.h ├── bsh │ ├── Makefile │ ├── Jamfile │ └── main.cpp └── 3way │ └── Jamfile ├── samples ├── Makefile ├── SampleService │ ├── Manifest.xml │ ├── Makefile │ ├── SampleServiceLib.h │ ├── ISampleService.idl │ ├── SampleService_components.cpp │ └── SampleService.h ├── SampleComponent │ ├── Manifest.xml │ ├── Makefile │ ├── Strings.xml │ ├── README.txt │ ├── Jamfile │ ├── main_samplecomponent.cpp │ ├── SampleComponent.h │ └── SampleComponent.cpp ├── ShellService │ ├── Manifest.xml │ ├── Makefile │ └── ShellService.bsh └── ServiceProcess │ ├── Makefile │ ├── Manifest.xml │ ├── Service.h │ ├── ServiceCommand.h │ ├── main_serviceprocess.cpp │ └── Service.cpp ├── servers ├── Makefile ├── smooved │ ├── icon1.ico │ ├── Makefile │ └── Jamfile └── binderproc │ ├── Makefile │ ├── Jamfile │ └── main.cpp ├── tools ├── Makefile ├── pidgen │ ├── pidgenfiles │ │ ├── supported_types.txt │ │ ├── IApplication.idl │ │ ├── IVirtualMachine.idl │ │ ├── ICommand.idl │ │ └── IFeatures.idl │ ├── cookinginstructions.txt │ ├── Makefile │ ├── OutputCPP.h │ ├── TypeBank.h │ ├── OutputI.h │ ├── SearchPath.h │ ├── README │ ├── idlc.h │ ├── SearchPath.cpp │ └── symbol.cpp └── makestrings │ ├── Strings.xml │ └── Makefile ├── components ├── Makefile ├── kits │ ├── Makefile │ └── support │ │ ├── Makefile │ │ ├── Manifest.xml │ │ ├── Jamfile │ │ └── SupportComponents.cpp ├── tools │ ├── Makefile │ ├── commands │ │ ├── Makefile │ │ ├── fortune │ │ │ ├── Manifest.xml │ │ │ ├── fortunes │ │ │ │ └── README │ │ │ ├── Makefile │ │ │ ├── rsc │ │ │ │ └── fortune.xrd │ │ │ ├── Jamfile │ │ │ └── FortuneCommand.h │ │ ├── printf │ │ │ ├── Manifest.xml │ │ │ ├── Makefile │ │ │ ├── rsc │ │ │ │ └── printf.xrd │ │ │ ├── Jamfile │ │ │ └── PrintfCommand.h │ │ ├── atom │ │ │ ├── Manifest.xml │ │ │ ├── Makefile │ │ │ ├── rsc │ │ │ │ └── atom.xrd │ │ │ └── Jamfile │ │ └── bperf │ │ │ ├── rsc │ │ │ └── bperf.xrd │ │ │ ├── Makefile │ │ │ ├── Manifest.xml │ │ │ └── Jamfile │ └── BinderShell │ │ ├── boot.sh │ │ ├── Makefile │ │ ├── Jamfile │ │ ├── rsc │ │ └── bsh.xrd │ │ ├── Test.h │ │ ├── vm.h │ │ ├── ANSIEscapes.h │ │ ├── CV.cpp │ │ └── CV.h └── services │ ├── Makefile │ ├── Settings │ ├── Manifest.xml │ ├── Makefile │ ├── Legacy.h │ ├── Jamfile │ ├── main.cpp │ └── Legacy.cpp │ ├── MemoryDealer │ ├── Manifest.xml │ ├── Makefile │ └── Jamfile │ ├── TokenSource │ ├── Manifest.xml │ ├── Makefile │ ├── Jamfile │ └── main_token_source.cpp │ └── base │ ├── Manifest.xml │ ├── Makefile │ ├── Informant.h │ ├── Uuid.h │ └── main_base.cpp ├── libraries ├── Makefile ├── libbinder │ ├── docs │ │ ├── pidgen.h │ │ ├── DataModel.h │ │ └── StorageKit.h │ ├── services │ │ └── Makefile │ ├── app │ │ ├── Makefile │ │ └── Jamfile │ ├── package │ │ ├── Makefile │ │ ├── Jamfile │ │ └── PackageKit.cpp │ ├── support │ │ ├── PerformanceCounter_A.s │ │ ├── KeyID.cpp │ │ └── Flattenable.cpp │ ├── xml │ │ ├── NamespaceCreator.cpp │ │ ├── Jamfile │ │ ├── Makefile │ │ ├── Tag.cpp │ │ ├── DataSource.cpp │ │ ├── BufferSource.cpp │ │ ├── XMLOStr.cpp │ │ ├── XMLIByteInputSource.cpp │ │ └── StringUtils.cpp │ ├── storage │ │ ├── Makefile │ │ ├── Jamfile │ │ └── StructuredNode.cpp │ ├── arch │ │ └── Makefile │ └── Makefile ├── libbinder_glue │ ├── Makefile │ └── Jamfile ├── libbinder_component_glue │ ├── Makefile │ ├── Jamfile │ └── binder_component_glue.cpp └── libdmprovider │ └── libdmprovider.mld ├── modules └── binder │ ├── binderdev.rules │ ├── startdriver │ ├── .binderdev.ko.cmd │ ├── .tmp_versions │ └── binderdev.mod │ ├── .binderdev.o.cmd │ ├── Makefile │ └── iobuffer.h ├── docs ├── raw │ ├── shim.gif │ ├── ps_logo.gif │ └── index.html ├── Makefile ├── Authors.h └── QuickStart.h ├── interfaces ├── support │ ├── ICatalog.idl │ ├── StdIO.idl │ ├── IMemory.idl │ ├── MessageCodes.idl │ ├── URL.idl │ ├── Package.idl │ ├── ITextStream.idl │ ├── Message.idl │ ├── INib.idl │ ├── IUuid.idl │ ├── ISelector.idl │ ├── IVirtualMachine.idl │ ├── IByteStream.idl │ ├── INodeObserver.idl │ ├── Jamfile │ └── ICatalogPermissions.idl ├── storage │ └── Jamfile ├── package │ ├── Jamfile │ └── IInstallHandler.idl └── app │ ├── ITerminalView.idl │ ├── IProgress.idl │ ├── IApplication.idl │ ├── Jamfile │ └── ICommand.idl └── headers ├── xml ├── Jamfile ├── Tag.h ├── Value2XML.h ├── StringUtils.h ├── XMLOStr.h ├── IXMLOStr.h ├── NamespaceCreator.h ├── XMLParser.h └── XML2ValueParser.h ├── app ├── Jamfile └── AppDefs.h ├── storage ├── Jamfile ├── StorageDefs.h └── BDatabaseStore.h ├── support ├── Jamfile ├── IHandler.h ├── TLS.h ├── SwappedValue.h ├── EventFlag.h ├── KeyID.h ├── StringTokenizer.h ├── Memory.h ├── StringIO.h ├── SignalHandler.h ├── InstantiateComponent.h ├── KernelStreams.h └── Selector.h ├── xml_p ├── debugging_xml.h ├── parsing.h └── validate_children.h ├── bsd-string.h ├── support_p ├── SignalThreadInit.h ├── BinderGlue.h ├── IntrusiveProfiler.h └── WindowsStreams.h ├── libpalmroot.h ├── package └── PackageKit.h ├── package_p └── ManifestParser.h └── ErrorMgr.h /scripts/process_wrapper_gdb.cmds: -------------------------------------------------------------------------------- 1 | run 2 | -------------------------------------------------------------------------------- /commands/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /samples/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /servers/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /components/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /libraries/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /components/kits/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /components/tools/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /components/services/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /components/tools/commands/Makefile: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /modules/binder/binderdev.rules: -------------------------------------------------------------------------------- 1 | KERNEL=="binder*", NAME="%k", MODE="0666" 2 | -------------------------------------------------------------------------------- /docs/raw/shim.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaikuArchives/OpenBinder/HEAD/docs/raw/shim.gif -------------------------------------------------------------------------------- /docs/raw/ps_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaikuArchives/OpenBinder/HEAD/docs/raw/ps_logo.gif -------------------------------------------------------------------------------- /commands/bomber/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /components/services/Settings/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /components/services/MemoryDealer/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /components/services/TokenSource/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /components/tools/BinderShell/boot.sh: -------------------------------------------------------------------------------- 1 | invoke $[new org.openbinder.tools.BinderShell] Run @{0->"sh"} 2 | 3 | 4 | -------------------------------------------------------------------------------- /servers/smooved/icon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaikuArchives/OpenBinder/HEAD/servers/smooved/icon1.ico -------------------------------------------------------------------------------- /components/services/base/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /interfaces/support/ICatalog.idl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaikuArchives/OpenBinder/HEAD/interfaces/support/ICatalog.idl -------------------------------------------------------------------------------- /libraries/libbinder/docs/pidgen.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaikuArchives/OpenBinder/HEAD/libraries/libbinder/docs/pidgen.h -------------------------------------------------------------------------------- /libraries/libbinder/docs/DataModel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaikuArchives/OpenBinder/HEAD/libraries/libbinder/docs/DataModel.h -------------------------------------------------------------------------------- /libraries/libbinder/services/Makefile: -------------------------------------------------------------------------------- 1 | servicesSources:= \ 2 | services/Informant.cpp 3 | 4 | servicesIDLs:= \ 5 | services/IInformant.idl 6 | -------------------------------------------------------------------------------- /modules/binder/startdriver: -------------------------------------------------------------------------------- 1 | # you almost certainly want to run this with sudo 2 | depmod 3 | modprobe binderdev 4 | echo lsmod | grep binder 5 | lsmod | grep binder 6 | -------------------------------------------------------------------------------- /samples/SampleService/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /libraries/libbinder/app/Makefile: -------------------------------------------------------------------------------- 1 | appSources:= \ 2 | app/BCommand.cpp \ 3 | app/SGetOpts.cpp 4 | 5 | appIDLs:= \ 6 | app/ICommand.idl \ 7 | app/IProgress.idl \ 8 | app/ITerminalView.idl 9 | -------------------------------------------------------------------------------- /libraries/libbinder/package/Makefile: -------------------------------------------------------------------------------- 1 | packageSources:= \ 2 | package/ManifestParser.cpp \ 3 | package/PackageManager.cpp \ 4 | package/PackageKit.cpp 5 | 6 | packageIDLs:= \ 7 | package/IInstallHandler.idl 8 | -------------------------------------------------------------------------------- /components/tools/commands/fortune/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | fortune 5 | 6 | 7 | -------------------------------------------------------------------------------- /components/tools/commands/printf/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | printf 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/SampleComponent/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sample_component 5 | 6 | 7 | -------------------------------------------------------------------------------- /components/tools/commands/atom/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | atom 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/ShellService/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /commands/bsh/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | TARGET_PATH:= $(OUT_EXECUTABLES) 7 | SRC_FILES:= \ 8 | main.cpp 9 | TARGET:= bsh 10 | 11 | include $(BUILD_BINDER_EXECUTABLE) 12 | -------------------------------------------------------------------------------- /scripts/test.bsh: -------------------------------------------------------------------------------- 1 | # This is a simple BinderShell script to run 2 | # bperf, a Binder command for basic performance 3 | # and validation tests. 4 | 5 | echo "Current environment: " $[env] 6 | 7 | res=$[bperf -v -A] 8 | 9 | echo "Test result: " $res 10 | -------------------------------------------------------------------------------- /servers/smooved/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | TARGET_PATH:= $(OUT_EXECUTABLES) 7 | SRC_FILES:= \ 8 | smoove.cpp 9 | TARGET:= smooved 10 | 11 | include $(BUILD_BINDER_EXECUTABLE) 12 | -------------------------------------------------------------------------------- /servers/binderproc/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | TARGET_PATH:= $(OUT_EXECUTABLES) 7 | SRC_FILES:= \ 8 | main.cpp 9 | TARGET:= binderproc 10 | 11 | include $(BUILD_BINDER_EXECUTABLE) 12 | -------------------------------------------------------------------------------- /components/services/base/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.services 7 | PACKAGE_LEAF:= base 8 | SRC_FILES:= \ 9 | main_base.cpp 10 | 11 | include $(BUILD_PACKAGE) 12 | -------------------------------------------------------------------------------- /components/kits/support/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.kits 7 | PACKAGE_LEAF:= support 8 | SRC_FILES:= \ 9 | SupportComponents.cpp 10 | 11 | include $(BUILD_PACKAGE) 12 | -------------------------------------------------------------------------------- /components/tools/commands/atom/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.tools.commands 7 | PACKAGE_LEAF:= Atom 8 | SRC_FILES:= \ 9 | Atom.cpp 10 | 11 | include $(BUILD_PACKAGE) 12 | -------------------------------------------------------------------------------- /libraries/libbinder_glue/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | TARGET_PATH:= $(OUT_LIBRARIES) 7 | 8 | SRC_FILES:= \ 9 | binder_glue.cpp 10 | TARGET:= libbinder_glue 11 | 12 | include $(BUILD_STATIC_LIBRARY) 13 | -------------------------------------------------------------------------------- /samples/ShellService/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.samples 7 | PACKAGE_LEAF:= ShellService 8 | SRC_FILES:= \ 9 | ShellService.bsh 10 | 11 | include $(BUILD_PACKAGE) 12 | -------------------------------------------------------------------------------- /components/services/TokenSource/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.services 7 | PACKAGE_LEAF:= TokenSource 8 | SRC_FILES:= \ 9 | main_token_source.cpp 10 | 11 | include $(BUILD_PACKAGE) 12 | -------------------------------------------------------------------------------- /components/tools/commands/fortune/fortunes/README: -------------------------------------------------------------------------------- 1 | fortunes.txt 2 | This is the fortune file included into the fortune.prc by default. 3 | Feel free to add inoffensive fortunes here ("inoffensive": "if this 4 | were on the front page of the Chronicle attributed to me I wouldn't 5 | mind terribly"). 6 | -------------------------------------------------------------------------------- /components/tools/commands/fortune/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.tools.commands 7 | PACKAGE_LEAF:= Fortune 8 | SRC_FILES:= \ 9 | FortuneCommand.cpp 10 | 11 | #include $(BUILD_PACKAGE) 12 | -------------------------------------------------------------------------------- /components/services/MemoryDealer/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.services 7 | PACKAGE_LEAF:= MemoryDealer 8 | SRC_FILES:= \ 9 | Heap.cpp \ 10 | main.cpp 11 | 12 | include $(BUILD_PACKAGE) 13 | -------------------------------------------------------------------------------- /components/tools/commands/printf/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.tools.commands 7 | PACKAGE_LEAF:= Printf 8 | SRC_FILES:= \ 9 | printf.c \ 10 | PrintfCommand.cpp 11 | 12 | #include $(BUILD_PACKAGE) 13 | -------------------------------------------------------------------------------- /samples/SampleComponent/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.samples 7 | PACKAGE_LEAF:= Component 8 | SRC_FILES:= \ 9 | SampleComponent.cpp \ 10 | main_samplecomponent.cpp 11 | 12 | include $(BUILD_PACKAGE) 13 | -------------------------------------------------------------------------------- /components/tools/commands/atom/rsc/atom.xrd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 'mnfs' 7 | "../Manifest.xml" 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /components/tools/commands/bperf/rsc/bperf.xrd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 'mnfs' 7 | "../Manifest.xml" 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /components/tools/commands/bperf/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.tools.commands 7 | PACKAGE_LEAF:= BPerf 8 | SRC_FILES:= \ 9 | main.cpp \ 10 | EffectIPC.cpp \ 11 | icache.cpp 12 | 13 | include $(BUILD_PACKAGE) 14 | -------------------------------------------------------------------------------- /components/tools/commands/printf/rsc/printf.xrd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 'mnfs' 7 | "../Manifest.xml" 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /modules/binder/.binderdev.ko.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/jparks/src/open-source/openbinder/modules/binder/binderdev.ko := ld -m elf_i386 -r -o /home/jparks/src/open-source/openbinder/modules/binder/binderdev.ko /home/jparks/src/open-source/openbinder/modules/binder/binderdev.o /home/jparks/src/open-source/openbinder/modules/binder/binderdev.mod.o 2 | -------------------------------------------------------------------------------- /tools/pidgen/pidgenfiles/supported_types.txt: -------------------------------------------------------------------------------- 1 | short 2 | long 3 | double 4 | float 5 | bool 6 | char 7 | string 8 | 9 | sptr 10 | BString 11 | BMessage 12 | 13 | int8 14 | int16 15 | int32 16 | int64 17 | uint8 18 | uint16 19 | uint32 20 | uint64 21 | 22 | size_t 23 | ssize_t 24 | status_t 25 | bigtime_t 26 | off_t 27 | 28 | -------------------------------------------------------------------------------- /components/tools/commands/fortune/rsc/fortune.xrd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 'text' 7 | "../fortunes/fortunes.txt" 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /samples/ServiceProcess/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.samples 7 | PACKAGE_LEAF:= ServiceProcess 8 | SRC_FILES:= \ 9 | Service.cpp \ 10 | ServiceCommand.cpp \ 11 | main_serviceprocess.cpp 12 | 13 | include $(BUILD_PACKAGE) 14 | -------------------------------------------------------------------------------- /components/kits/support/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /libraries/libbinder_component_glue/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | TARGET_PATH:= $(OUT_LIBRARIES) 7 | 8 | SRC_FILES:= \ 9 | binder_component_glue.cpp 10 | TARGET:= libbinder_component_glue 11 | LOCAL_C_INCLUDES+= $(SRC_LIBRARIES)/libbinder_glue 12 | 13 | include $(BUILD_STATIC_LIBRARY) 14 | -------------------------------------------------------------------------------- /libraries/libbinder/support/PerformanceCounter_A.s: -------------------------------------------------------------------------------- 1 | AREA |.text|, CODE, READONLY 2 | 3 | 4 | EXPORT ReadPerformanceCounter 5 | ReadPerformanceCounter FUNCTION 6 | mov r1, pc 7 | ; jump to the prefetch abort handler will generate to generate a prefetch 8 | ; abort (this only works from user mode) 9 | mov pc, #0x0c 10 | bx lr 11 | 12 | ENDFUNC 13 | 14 | END 15 | -------------------------------------------------------------------------------- /scripts/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | TARGET_PATH:= $(OUT_SCRIPTS) 7 | 8 | SCRIPTS:= \ 9 | setup_env.sh \ 10 | process_wrapper.sh \ 11 | process_wrapper_gdb.sh \ 12 | process_wrapper_gdb.cmds \ 13 | boot_script.bsh \ 14 | user_context.bsh \ 15 | test.bsh 16 | 17 | include $(BUILD_SCRIPT) 18 | -------------------------------------------------------------------------------- /components/services/Settings/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.services 7 | PACKAGE_LEAF:= Settings 8 | LOCAL_CFLAGS:= -DOPENBINDER_SETTINGS_BUILD=1 9 | SRC_FILES:= \ 10 | SettingsCatalog.cpp \ 11 | main.cpp 12 | 13 | # Legacy.cpp \ 14 | 15 | include $(BUILD_PACKAGE) 16 | -------------------------------------------------------------------------------- /components/tools/BinderShell/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | PACKAGE_NAMESPACE:= org.openbinder.tools 7 | PACKAGE_LEAF:= BinderShell 8 | SRC_FILES:= \ 9 | BinderCommands.cpp \ 10 | bsh.cpp \ 11 | CV.cpp \ 12 | Parser.cpp \ 13 | SyntaxTree.cpp \ 14 | Test.cpp \ 15 | vm.cpp 16 | 17 | include $(BUILD_PACKAGE) 18 | -------------------------------------------------------------------------------- /tools/makestrings/Strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | America/Denver 4 | USA (Mountain) 5 | Etats-Unis (Rocheuses) 6 | 7 | 8 | 9 | America/Los_Angeles 10 | USA (Pacific) 11 | Etats-Unis (Pacifique) 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/tools/commands/bperf/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bperf 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /libraries/libbinder/package/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | packageSources = 12 | IInstallHandler.cpp 13 | ManifestParser.cpp 14 | PackageManager.cpp 15 | PackageKit.cpp 16 | ; 17 | -------------------------------------------------------------------------------- /headers/xml/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build xml headers 12 | PSSubDir TOP headers PDK xml ; 13 | 14 | # Define local files 15 | local files = [ Glob $(SUBDIR) : *.h ] ; 16 | 17 | PdkFile $(files) ; 18 | -------------------------------------------------------------------------------- /modules/binder/.tmp_versions/binderdev.mod: -------------------------------------------------------------------------------- 1 | /home/jparks/src/open-source/openbinder/modules/binder/binderdev.ko 2 | /home/jparks/src/open-source/openbinder/modules/binder/iobuffer.o /home/jparks/src/open-source/openbinder/modules/binder/binder.o /home/jparks/src/open-source/openbinder/modules/binder/binder_node.o /home/jparks/src/open-source/openbinder/modules/binder/binder_proc.o /home/jparks/src/open-source/openbinder/modules/binder/binder_thread.o /home/jparks/src/open-source/openbinder/modules/binder/binder_transaction.o 3 | -------------------------------------------------------------------------------- /samples/ServiceProcess/Manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | service_command 12 | 13 | 14 | -------------------------------------------------------------------------------- /headers/app/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build app headers 12 | PSSubDir TOP headers PDK app ; 13 | 14 | # Define local files 15 | local files = 16 | [ Glob $(SUBDIR) : *.h ] 17 | ; 18 | 19 | PdkFile $(files) ; 20 | -------------------------------------------------------------------------------- /headers/storage/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build storage headers 12 | PSSubDir TOP headers PDK storage ; 13 | 14 | # Define local files 15 | local files = [ Glob $(SUBDIR) : *.h ] ; 16 | 17 | PdkFile $(files) ; 18 | -------------------------------------------------------------------------------- /headers/support/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build support headers 12 | PSSubDir TOP headers PDK support ; 13 | 14 | # Define local files 15 | local files = 16 | [ Glob $(SUBDIR) : *.h ] 17 | ; 18 | 19 | PdkFile $(files) ; 20 | -------------------------------------------------------------------------------- /commands/3way/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | PSSubDir TOP components tests 3way ; 12 | 13 | # make the bomber command 14 | Main 3way : 15 | 3way.cpp 16 | ; 17 | LinkLibraries 3way : 18 | libbinder$(SUFSHL) 19 | libbinder_glue$(SUFLIB) 20 | ; 21 | 22 | -------------------------------------------------------------------------------- /tools/makestrings/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | TARGET_PATH:= $(OUT_HOST_EXECUTABLES) 7 | NO_INTERFACE_DEPENDENCY:= 1 8 | SRC_FILES:= \ 9 | Strings.cpp 10 | LIB_FILES:= \ 11 | $(OUT_LIBRARIES)/libbinder_bootstrap.a 12 | TARGET:= makestrings 13 | 14 | # We normally want to do a release build for pidgen, 15 | # since it is used as part of the build. 16 | LOCAL_CFLAGS:= $(TOOL_CFLAGS) 17 | LOCAL_LDFLAGS:= $(TOOL_LDFLAGS) 18 | 19 | include $(BUILD_HOST_EXECUTABLE) 20 | -------------------------------------------------------------------------------- /docs/raw/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | PalmSource Doxygen Documentation 4 | 5 | 6 | 7 | 8 |

Doxygen Documentation Links

9 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /libraries/libbinder/app/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | appSources = 12 | # IApplication.cpp 13 | # IApplicationManager.cpp 14 | ICommand.cpp 15 | ITerminalView.cpp 16 | IProgress.cpp 17 | 18 | # ILegacyEventQueue.cpp 19 | 20 | SGetOpts.cpp 21 | BCommand.cpp 22 | ; 23 | -------------------------------------------------------------------------------- /libraries/libbinder/xml/NamespaceCreator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | -------------------------------------------------------------------------------- /libraries/libbinder_glue/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build libbinder_glue library 12 | PSSubDir TOP libraries libbinder_glue ; 13 | 14 | # Build the static lib 15 | Library libbinder_glue : binder_glue.cpp ; 16 | 17 | MakeLocate libbinder_glue$(SUFLIB) : $(LIB_DIR) ; 18 | 19 | -------------------------------------------------------------------------------- /modules/binder/.binderdev.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/jparks/src/open-source/openbinder/modules/binder/binderdev.o := ld -m elf_i386 -r -o /home/jparks/src/open-source/openbinder/modules/binder/binderdev.o /home/jparks/src/open-source/openbinder/modules/binder/iobuffer.o /home/jparks/src/open-source/openbinder/modules/binder/binder.o /home/jparks/src/open-source/openbinder/modules/binder/binder_node.o /home/jparks/src/open-source/openbinder/modules/binder/binder_proc.o /home/jparks/src/open-source/openbinder/modules/binder/binder_thread.o /home/jparks/src/open-source/openbinder/modules/binder/binder_transaction.o 2 | -------------------------------------------------------------------------------- /components/services/TokenSource/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2002 PalmSource, Inc. or its subsidiaries. 4 | # All rights reserved. 5 | # 6 | # File: Jamfile 7 | # 8 | ############################################################################### 9 | 10 | PSSubDir TOP components services token_source ; 11 | 12 | # Define local sources 13 | local sources = 14 | main_token_source.cpp 15 | ; 16 | 17 | local PKGNAME = org.openbinder.services.TokenSource ; 18 | 19 | Component TokenSource : 20 | $(sources) 21 | ; 22 | -------------------------------------------------------------------------------- /scripts/process_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # When using a process wrapper, this is the top-level 4 | # command that is executed instead of the actual binder 5 | # process server (binderproc). It starts a new xterm 6 | # in which the user can interact with the new process. 7 | # Inside of the xterm is a gdb session, through which 8 | # the user can debug the new process. 9 | 10 | # Save away these variables, since we may loose then 11 | # when starting in the xterm. 12 | export PREV_LD_LIBRARY_PATH=$LD_LIBRARY_PATH 13 | export PREV_PATH=$PATH 14 | 15 | xterm -e {{OUT_SCRIPTS}}/process_wrapper_gdb.sh $1 16 | -------------------------------------------------------------------------------- /samples/SampleComponent/Strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | world 4 | World 5 | I don't know French 6 | 7 | 8 | 9 | hello 10 | says: Hello, 11 | says: Hello, 12 | 13 | 14 | 15 | documentation 16 | Sample component implementing a Binder shell command 17 | Sample component implementing a Binder shell command 18 | 19 | 20 | -------------------------------------------------------------------------------- /commands/bsh/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | PSSubDir TOP servers bsh ; 12 | 13 | # Define local sources 14 | local sources = 15 | main.cpp 16 | ; 17 | 18 | if $(DISABLE_LIBSEGFAULT) = "" { 19 | LINKFLAGS on binderproc += -lSegFault ; 20 | } 21 | 22 | Main bsh : $(sources) ; 23 | 24 | LinkLibraries bsh : 25 | libbinder$(SUFSHL) 26 | libbinder_glue$(SUFLIB) 27 | ; 28 | -------------------------------------------------------------------------------- /headers/support/IHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_HANDLER_INTERFACE_H_ 14 | #define _SUPPORT_HANDLER_INTERFACE_H_ 15 | 16 | #endif /* _SUPPORT_HANDLER_INTERFACE_H_ */ 17 | -------------------------------------------------------------------------------- /components/kits/support/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build MemoryDealer 12 | PSSubDir TOP components kits support ; 13 | 14 | # Define local sources 15 | local sources = 16 | SupportComponents.cpp 17 | ; 18 | 19 | # Set local vars 20 | local PKGNAME = org.openbinder.kits.support ; 21 | 22 | # Build the component 23 | Component support : $(sources) Strings.xml ; 24 | -------------------------------------------------------------------------------- /libraries/libbinder/xml/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | xmlSources = 12 | BufferSource.cpp 13 | Creator.cpp 14 | DataSource.cpp 15 | ParseContext.cpp 16 | ParseXML.cpp 17 | StringUtils.cpp 18 | Tag.cpp 19 | Writer.cpp 20 | XMLIByteInputSource.cpp 21 | XMLOStr.cpp 22 | XMLParserCore.cpp 23 | XMLParser.cpp 24 | XMLWriter.cpp 25 | XML2ValueParser.cpp 26 | Value2XML.cpp 27 | ; 28 | -------------------------------------------------------------------------------- /interfaces/support/StdIO.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | type StdIO 17 | { 18 | methods: 19 | StdIO dummy(); 20 | }; 21 | 22 | } } // namespace palmos::support -------------------------------------------------------------------------------- /servers/binderproc/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | PSSubDir TOP servers binderproc ; 12 | 13 | # Define local sources 14 | local sources = 15 | main.cpp 16 | ; 17 | 18 | if $(DISABLE_LIBSEGFAULT) = "" { 19 | LINKFLAGS on binderproc += -lSegFault ; 20 | } 21 | 22 | Main binderproc : $(sources) ; 23 | 24 | LinkLibraries binderproc : 25 | libbinder$(SUFSHL) 26 | libbinder_glue$(SUFLIB) 27 | ; 28 | -------------------------------------------------------------------------------- /libraries/libbinder_component_glue/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build libbinder_component_glue library 12 | PSSubDir TOP libraries libbinder_component_glue ; 13 | 14 | SubDirHdrs TOP libraries libbinder_glue ; 15 | 16 | # Build the static lib 17 | Library libbinder_component_glue : binder_component_glue.cpp ; 18 | 19 | MakeLocate libbinder_component_glue$(SUFLIB) : $(LIB_DIR) ; 20 | 21 | -------------------------------------------------------------------------------- /interfaces/support/IMemory.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | interface IMemory 17 | { 18 | properties: 19 | bool dummy; 20 | } 21 | 22 | } } // namespace palmos::support 23 | -------------------------------------------------------------------------------- /components/services/Settings/Legacy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef LEGACY_H 14 | #define LEGACY_H 15 | 16 | #include 17 | 18 | SValue legacy_date_format(const SValue& value); 19 | 20 | #endif // LEGACY_H 21 | -------------------------------------------------------------------------------- /interfaces/support/MessageCodes.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | type xxMessageCodesDummy 17 | { 18 | methods: 19 | SValue AsValue(); 20 | }; 21 | 22 | } } // namespace palmos::view 23 | -------------------------------------------------------------------------------- /interfaces/support/URL.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | type SUrl { 17 | methods: 18 | SValue AsValue(); 19 | SUrl SUrl(SValue url); 20 | }; 21 | 22 | } } // namespace palmos::support -------------------------------------------------------------------------------- /components/services/Settings/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2002 PalmSource, Inc. or its subsidiaries. 4 | # All rights reserved. 5 | # 6 | # File: Jamfile 7 | # 8 | ############################################################################### 9 | 10 | # Jamfile to build settings 11 | PSSubDir TOP components services settings ; 12 | 13 | # Define local sources 14 | local sources = 15 | SettingsCatalog.cpp 16 | main.cpp 17 | Legacy.cpp 18 | ; 19 | 20 | # Set local vars 21 | local PKGNAME = org.openbinder.services.Settings ; 22 | 23 | # Build the component 24 | Component Settings : 25 | $(sources) 26 | ; 27 | 28 | -------------------------------------------------------------------------------- /interfaces/storage/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build support interface files 12 | if ! $(PALMSOURCE_DEV_KIT) { 13 | PSSubDir TOP interfaces PDK storage ; 14 | } else { 15 | PSSubDir TOP PDK interfaces storage ; 16 | } 17 | 18 | InterfaceIdl IReferable.cpp : IReferable.idl : libbinder ; 19 | 20 | # Build the deliverables 21 | if ! $(PALMSOURCE_DEV_KIT) { 22 | PdkFile Jamfile [ Glob $(SUBDIR) : *.idl ] ; 23 | } 24 | -------------------------------------------------------------------------------- /interfaces/package/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build package interface files 12 | if ! $(PALMSOURCE_DEV_KIT) { 13 | PSSubDir TOP interfaces PDK package ; 14 | } else { 15 | PSSubDir TOP PDK interfaces package ; 16 | } 17 | 18 | InterfaceIdl IInstallHandler.cpp : IInstallHandler.idl : libbinder ; 19 | 20 | # Build the deliverables 21 | if ! $(PALMSOURCE_DEV_KIT) { 22 | PdkFile Jamfile [ Glob $(SUBDIR) : *.idl ] ; 23 | } 24 | -------------------------------------------------------------------------------- /interfaces/support/Package.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | type SPackage { 17 | methods: 18 | SValue AsValue(); 19 | SPackage SPackage(SValue url); 20 | }; 21 | 22 | } } // namespace palmos::support 23 | -------------------------------------------------------------------------------- /tools/pidgen/cookinginstructions.txt: -------------------------------------------------------------------------------- 1 | to build pidgen, use jam -q pidgen.exe. 2 | 3 | the bison and flex files should be generated and renamed automatically via the Jamfile 4 | if using the bison and flex binaries checked into build_system doesn't work(most likely because you're using a different cygwin runtime from 5 | the one these exes require), you can use LEX = flex ; YACC = bison -d -v -y ; to invoke the flex and bison resident on your machine. there might 6 | be some minor problems such as bison complaining about yylex not taking 0 parameters - this is a known problem on old versions of cygwin bison, 7 | just feed it the params it's supposed to get and all should be well. 8 | 9 | for rolling pidgen jam help pls see Diane Holt -------------------------------------------------------------------------------- /tools/pidgen/pidgenfiles/IApplication.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace app { 15 | 16 | interface IApplication 17 | { 18 | methods: 19 | void Start(); 20 | void Stop(); // ??? 21 | } 22 | 23 | } } // namespace palmos::app 24 | 25 | -------------------------------------------------------------------------------- /commands/bomber/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | PSSubDir TOP components tests binder_fork_bomb ; 12 | 13 | # make the bomber command 14 | Main bomber : 15 | bomber.cpp 16 | ; 17 | LinkLibraries bomber : 18 | libbinder$(SUFSHL) 19 | libbinder_glue$(SUFLIB) 20 | ; 21 | 22 | 23 | # make the bsh command 24 | local PKGNAME = org.openbinder.tests.binder_fork_bomb ; 25 | 26 | Component binder_fork_bomb : 27 | bomb_host.cpp 28 | 29 | libbinder$(SUFSHL) 30 | ; 31 | 32 | -------------------------------------------------------------------------------- /components/services/MemoryDealer/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build MemoryDealer 12 | PSSubDir TOP components services MemoryDealer ; 13 | 14 | # Define local sources 15 | local sources = 16 | main.cpp 17 | Heap.cpp 18 | ; 19 | 20 | # Set local vars 21 | local PKGNAME = org.openbinder.services.MemoryDealer ; 22 | 23 | # Build the component 24 | Component MemoryDealer : $(sources) ; 25 | 26 | SetPkgLinkFlags MemoryDealer : -lpthread -lrt ; 27 | 28 | 29 | -------------------------------------------------------------------------------- /libraries/libbinder/storage/Makefile: -------------------------------------------------------------------------------- 1 | storageBootstrapSources= \ 2 | storage/File.cpp 3 | 4 | storageSources:= \ 5 | storage/CatalogDelegate.cpp \ 6 | storage/DatumGeneratorInt.cpp \ 7 | storage/File.cpp \ 8 | storage/GenericDatum.cpp \ 9 | storage/GenericIterable.cpp \ 10 | storage/GenericNode.cpp \ 11 | storage/IndexedDataNode.cpp \ 12 | storage/IndexedIterable.cpp \ 13 | storage/IndexedTableNode.cpp \ 14 | storage/MetaDataNode.cpp \ 15 | storage/NodeDelegate.cpp \ 16 | storage/StreamDatum.cpp \ 17 | storage/StructuredNode.cpp \ 18 | storage/ValueDatum.cpp 19 | 20 | # storage/VFSFile.cpp 21 | # BDatabaseStore.cpp 22 | # SDatabase.cpp 23 | # IDatabaseTable.cpp 24 | # DatabaseTable.cpp 25 | 26 | storageIDLs := \ 27 | storage/IReferable.idl 28 | -------------------------------------------------------------------------------- /samples/SampleComponent/README.txt: -------------------------------------------------------------------------------- 1 | This sample demonstrates writing a Binder component. The component 2 | is implementing the ICommand interface, so that it can be used as 3 | a shell command. (All shell commands are implemented as components.) 4 | 5 | To see it in action, be sure the component package is available (the 6 | OpenBinder build system will do this for you) and type "sample_component" in the shell. 7 | 8 | Be sure if you are going to write some real code derived from this 9 | example that you change the package name in the Makefile to be a name 10 | in your own namespace. 11 | 12 | If you want to write something besides a command, you will want to 13 | change the interface the component implements and update the 14 | Manifest.xml file appropriately. 15 | -------------------------------------------------------------------------------- /commands/bomber/bomb_host.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef BOMB_HOST_H 14 | #define BOMB_HOST_H 15 | 16 | #include 17 | 18 | B_CONST_STRING_VALUE_LARGE(key_GiveObject, "GiveObject", ); 19 | B_CONST_STRING_VALUE_LARGE(key_Dump, "Dump", ); 20 | 21 | #endif // BOMB_HOST_H 22 | 23 | -------------------------------------------------------------------------------- /components/tools/BinderShell/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build BinderShell 12 | PSSubDir TOP components tools BinderShell ; 13 | 14 | # Define local sources 15 | local sources = 16 | BinderCommands.cpp 17 | bsh.cpp 18 | CV.cpp 19 | Parser.cpp 20 | SyntaxTree.cpp 21 | Test.cpp 22 | vm.cpp 23 | ; 24 | 25 | # Set local vars 26 | local PKGNAME = org.openbinder.tools.BinderShell ; 27 | 28 | # Build the component 29 | Component BinderShell : 30 | $(sources) 31 | ; 32 | 33 | -------------------------------------------------------------------------------- /interfaces/support/ITextStream.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | interface ITextInput 17 | { 18 | properties: 19 | bool dummy; 20 | } 21 | 22 | interface ITextOutput 23 | { 24 | properties: 25 | bool dummy; 26 | } 27 | 28 | } } // namespace palmos::support 29 | -------------------------------------------------------------------------------- /scripts/setup_env.sh: -------------------------------------------------------------------------------- 1 | # This POSIX shell scripts sets up environment 2 | # variables needed by the Binder runtime to find 3 | # its packages and executables (if it hasn't been 4 | # installed in its standard location). 5 | 6 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:}{{OUT_LIBRARIES}} 7 | export PATH=$PATH:{{OUT_HOST_EXECUTABLES}} 8 | export BINDER_PACKAGE_PATH={{OUT_PACKAGES}} 9 | export BINDER_DIST_PATH={{TOP}} 10 | 11 | # This command enables the debugging wrapper for 12 | # processes started with SContext::New(). 13 | function enable_process_wrapper 14 | { 15 | export BINDER_PROCESS_WRAPPER={{OUT_SCRIPTS}}/process_wrapper.sh 16 | } 17 | 18 | # Disable the process debugging wrapper. 19 | function disable_process_wrapper { 20 | unset BINDER_PROCESS_WRAPPER 21 | } 22 | -------------------------------------------------------------------------------- /interfaces/support/Message.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | // SMessage is currently a built-in type, but it shouldn't be. 17 | type xxSMessage { 18 | methods: 19 | SValue AsValue(); 20 | xxSMessage xxSMessage(SValue o); 21 | }; 22 | 23 | } } // namespace palmos::support 24 | -------------------------------------------------------------------------------- /headers/app/AppDefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _APP_DEFS_H_ 14 | #define _APP_DEFS_H_ 15 | 16 | #if _SUPPORTS_NAMESPACE 17 | namespace palmos { 18 | namespace app { 19 | #endif // _SUPPORTS_NAMESPACE 20 | 21 | #if _SUPPORTS_NAMESPACE 22 | } } // namespace palmos::app 23 | #endif // _SUPPORTS_NAMESPACE 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /tools/pidgen/pidgenfiles/IVirtualMachine.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | interface IVirtualMachine 17 | { 18 | methods: 19 | void Init(); 20 | IBinder InstantiateComponent(BValue componentInfo, BString component, BValue args); 21 | } 22 | 23 | } } // namespace palmos::support -------------------------------------------------------------------------------- /components/tools/BinderShell/rsc/bsh.xrd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 144 9 | 16 10 | 10 11 | 8 12 | NONE 13 | TRUE 14 | 15 | 0xD2 16 | 17 | FALSE 18 | "./Bitmaps/ShellIcon.bmp" 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /headers/xml_p/debugging_xml.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #if _SUPPORTS_NAMESPACE 14 | namespace palmos { 15 | namespace xml { 16 | #endif 17 | 18 | // Defined in ElementDecl.cpp 19 | void _print_detialed_element_decl(BElementDecl * decl); 20 | 21 | #if _SUPPORTS_NAMESPACE 22 | }; // namespace xml 23 | }; // namespace palmos 24 | #endif 25 | -------------------------------------------------------------------------------- /libraries/libbinder/arch/Makefile: -------------------------------------------------------------------------------- 1 | 2 | # Look at CC commands to determine which implementation 3 | # of atomics ops should be used 4 | 5 | ifneq (,$(findstring arm,$(shell $(HOST_CC) -dumpmachine))) 6 | bootstrap_arch_name := ARM 7 | else 8 | ifneq (,$(findstring 86,$(shell $(HOST_CC) -dumpmachine))) 9 | bootstrap_arch_name := x86 10 | else 11 | bootstrap_arch_name := generic 12 | endif 13 | endif 14 | 15 | ifneq (,$(findstring arm,$(shell $(CC) -dumpmachine))) 16 | arch_name := ARM 17 | else 18 | ifneq (,$(findstring 86,$(shell $(CC) -dumpmachine))) 19 | arch_name := x86 20 | else 21 | arch_name := generic 22 | endif 23 | endif 24 | 25 | archBootstrapSources:= \ 26 | arch/$(bootstrap_arch_name)/atomic.c 27 | 28 | archSources:= \ 29 | arch/$(arch_name)/atomic.c 30 | 31 | -------------------------------------------------------------------------------- /tools/pidgen/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | TARGET_PATH:= $(OUT_HOST_EXECUTABLES) 7 | NO_INTERFACE_DEPENDENCY:= 1 8 | DONT_BUILD_TARGET:= 1 9 | SRC_FILES:= \ 10 | idlstruct.cpp \ 11 | InterfaceRec.cpp \ 12 | AST.cpp \ 13 | main.cpp \ 14 | OutputCPP.cpp \ 15 | OutputI.cpp \ 16 | OutputUtil.cpp \ 17 | symbol.cpp \ 18 | symbolstack.cpp \ 19 | TypeBank.cpp \ 20 | yacc.y \ 21 | scanner.l \ 22 | WSDL.cpp \ 23 | WsdlOutput.cpp 24 | LIB_FILES:= \ 25 | $(OUT_LIBRARIES)/libbinder_bootstrap.a 26 | TARGET:= pidgen 27 | 28 | # We normally want to do a release build for pidgen, 29 | # since it is used as part of the build. 30 | LOCAL_CFLAGS:= $(TOOL_CFLAGS) 31 | LOCAL_LDFLAGS:= $(TOOL_LDFLAGS) 32 | 33 | include $(BUILD_HOST_EXECUTABLE) 34 | -------------------------------------------------------------------------------- /interfaces/app/ITerminalView.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | import 14 | 15 | namespace palmos { 16 | namespace app { 17 | 18 | interface ITerminalView 19 | { 20 | properties: 21 | [readonly]IByteOutput byteOutput; 22 | [readonly]IByteInput byteInput; 23 | 24 | methods: 25 | void Shutdown(); 26 | } 27 | 28 | } } 29 | 30 | -------------------------------------------------------------------------------- /interfaces/package/IInstallHandler.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace package { 15 | 16 | interface IInstallHandler 17 | { 18 | enum 19 | { 20 | 21 | INSTALL = 0, 22 | BOOT = 1 23 | }; 24 | 25 | methods: 26 | void OnInstall(uint32_t which); 27 | } 28 | 29 | 30 | } } // namespace palmos::package 31 | 32 | 33 | -------------------------------------------------------------------------------- /scripts/process_wrapper_gdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This is the command running inside the xterm of our 4 | # debug wrapper. It needs to take care of starting 5 | # the binderproc server, so it can attach to the parent 6 | # process. In addition, here we run binderproc inside 7 | # of a gdb session to allow for debugging. 8 | 9 | # On some systems, running xterm will cause LD_LIBRARY_PATH 10 | # to be cleared, so restore it and PATH to be safe. 11 | export PATH=$PREV_PATH 12 | export LD_LIBRARY_PATH=$PREV_LD_LIBRARY_PATH 13 | #source {{OUT_SCRIPTS}}/setup_env.sh 14 | 15 | # Start binderproc (or whatever sub-command is being run) 16 | # inside of gdb, giving gdb an initial command script to 17 | # automatically run the process without user intervention. 18 | gdb -q -x {{OUT_SCRIPTS}}/process_wrapper_gdb.cmds $1 19 | -------------------------------------------------------------------------------- /samples/SampleService/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | BASE_PATH:= $(LOCAL_PATH) 6 | TARGET_PATH:= $(OUT_LIBRARIES) 7 | 8 | # Note that we include our local IDL file in the 9 | # source list. If, instead, the IDL file was placed 10 | # in the "interfaces" directory, it would be put 11 | # in the IDL_FILES list. 12 | SRC_FILES:= \ 13 | SampleServiceLib.cpp \ 14 | ISampleService.idl 15 | IDL_FILES:= 16 | TARGET:= libsampleservice 17 | 18 | include $(BUILD_BINDER_SHARED_LIBRARY) 19 | 20 | include $(CLEAR_VARS) 21 | 22 | BASE_PATH:= $(LOCAL_PATH) 23 | PACKAGE_NAMESPACE:= org.openbinder.samples 24 | PACKAGE_LEAF:= Service 25 | SHARED_LIBRARIES:= libsampleservice 26 | SRC_FILES:= \ 27 | SampleService.cpp \ 28 | SampleService_components.cpp 29 | 30 | include $(BUILD_PACKAGE) 31 | -------------------------------------------------------------------------------- /headers/bsd-string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _PALMOS_STRING_H_ 14 | #define _PALMOS_STRING_H_ 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | size_t strlcpy(char *dst, const char *src, size_t siz); 21 | size_t strlcat(char *dst, const char *src, size_t siz); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /interfaces/support/INib.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | interface INib 17 | { 18 | methods: 19 | SValue ListProperties(); 20 | SValue GetProperty(SValue values); 21 | status_t PutProperty(SValue values); 22 | status_t RemoveProperty(SValue values); 23 | } 24 | 25 | } } // namespace palmos::support 26 | 27 | 28 | -------------------------------------------------------------------------------- /libraries/libbinder/xml/Makefile: -------------------------------------------------------------------------------- 1 | xmlBootstrapSources:= \ 2 | xml/BufferSource.cpp \ 3 | xml/Creator.cpp \ 4 | xml/DataSource.cpp \ 5 | xml/ParseContext.cpp \ 6 | xml/ParseXML.cpp \ 7 | xml/StringUtils.cpp \ 8 | xml/Writer.cpp \ 9 | xml/XML2ValueParser.cpp \ 10 | xml/XMLIByteInputSource.cpp \ 11 | xml/XMLOStr.cpp \ 12 | xml/XMLParser.cpp \ 13 | xml/XMLWriter.cpp \ 14 | xml/XMLParserCore.cpp \ 15 | xml/Value2XML.cpp 16 | 17 | xmlSources:= \ 18 | xml/BufferSource.cpp \ 19 | xml/Creator.cpp \ 20 | xml/DataSource.cpp \ 21 | xml/ParseContext.cpp \ 22 | xml/ParseXML.cpp \ 23 | xml/StringUtils.cpp \ 24 | xml/Tag.cpp \ 25 | xml/Writer.cpp \ 26 | xml/XML2ValueParser.cpp \ 27 | xml/XMLIByteInputSource.cpp \ 28 | xml/XMLOStr.cpp \ 29 | xml/XMLParser.cpp \ 30 | xml/XMLWriter.cpp \ 31 | xml/XMLParserCore.cpp \ 32 | xml/Value2XML.cpp 33 | -------------------------------------------------------------------------------- /libraries/libbinder/docs/StorageKit.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @page StorageKit Storage Kit 3 | 4 |
5 |
\< @ref BinderInspect | @ref OpenBinder | @ref BinderDataModel \>
6 |
7 |
8 | 9 | The Storage Kit contains classes for accessing and operating on 10 | data — such as files and directories — and more significantly 11 | for implementing the general @ref BinderDataModel interfaces. 12 | 13 | @section Topics Topics 14 | 15 | - @subpage BinderDataModel is a set of interfaces built on top of the 16 | @ref BinderKit that provide a general, rich abstraction for data 17 | manipulation. The interfaces are designed to support both filesystem and 18 | database styles of data interaction. 19 | - @subpage WritingDataObjects descibes how to write your own objects that provide 20 | data in the data model. 21 | */ 22 | -------------------------------------------------------------------------------- /samples/SampleService/SampleServiceLib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef __SAMPLESERVICELIB_H__ 14 | #define __SAMPLESERVICELIB_H__ 15 | 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | //! Test the sample service. 23 | int32_t SampleServiceTest(void); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif // __SAMPLESERVICELIB_H__ 30 | -------------------------------------------------------------------------------- /components/tools/commands/bperf/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build bperf 12 | PSSubDir TOP components tools commands bperf ; 13 | 14 | # Define local sources 15 | local sources = 16 | main.cpp 17 | EffectIPC.cpp 18 | icache.cpp 19 | ; 20 | 21 | # Set local vars 22 | local CREATOR = bprf ; 23 | local TYPE = libr ; 24 | local PKGNAME = org.openbinder.tools.commands.BPerf ; 25 | 26 | # Build the component 27 | Component BPerf : 28 | $(sources) 29 | 30 | libbinder$(SUFSHL) 31 | libinterface$(SUFSHL) 32 | libprotein$(SUFSHL) 33 | libstudio$(SUFSHL) 34 | ; 35 | 36 | -------------------------------------------------------------------------------- /components/services/base/Informant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef INFORMANT_H 14 | #define INFORMANT_H 15 | 16 | #include 17 | #include 18 | 19 | class Informant : public BInformant 20 | { 21 | public: 22 | Informant(const SContext& context) :BInformant(context) {} 23 | private: 24 | SPackageSptr m_package; 25 | }; 26 | 27 | 28 | #endif // INFORMANT_H 29 | -------------------------------------------------------------------------------- /libraries/libbinder/storage/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | storageSources = 12 | # BDatabaseStore.cpp 13 | CatalogDelegate.cpp 14 | DatumGeneratorInt.cpp 15 | File.cpp 16 | GenericDatum.cpp 17 | GenericIterable.cpp 18 | GenericNode.cpp 19 | IndexedDataNode.cpp 20 | IndexedIterable.cpp 21 | IndexedTableNode.cpp 22 | IReferable.cpp 23 | MetaDataNode.cpp 24 | NodeDelegate.cpp 25 | # SDatabase.cpp 26 | StreamDatum.cpp 27 | StructuredNode.cpp 28 | ValueDatum.cpp 29 | VFSFile.cpp 30 | ; 31 | 32 | #if $(COMPONENT_MODEL) = SharedLibs 33 | #{ 34 | # supportSources += Static.cpp ; 35 | #} 36 | -------------------------------------------------------------------------------- /components/tools/commands/fortune/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build Fortune 12 | PSSubDir TOP components tools commands fortune ; 13 | 14 | # For fortunes.txt 15 | addDirName SEARCH_SOURCE : $(SUBDIR) fortunes ; 16 | 17 | # Define local sources 18 | local sources = 19 | FortuneCommand.cpp 20 | ; 21 | 22 | # Set local vars 23 | local CREATOR = fort ; 24 | local TYPE = libr ; 25 | local PDBNAME = fortune ; 26 | local PKGNAME = org.openbinder.tools.commands.Fortune ; 27 | 28 | # Build the component 29 | Component Fortune : 30 | fortune.xrd 31 | 32 | $(sources) 33 | 34 | libprotein$(SUFSHL) 35 | ; 36 | 37 | -------------------------------------------------------------------------------- /components/services/Settings/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "SettingsCatalog.h" 17 | 18 | sptr InstantiateComponent( const SString& component, 19 | const SContext& context, 20 | const SValue& args) 21 | { 22 | if (component == "") 23 | { 24 | return BSettingsCatalog::CreateRoot()->AsBinder(); 25 | } 26 | 27 | return NULL; 28 | } 29 | -------------------------------------------------------------------------------- /components/tools/commands/printf/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2003 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.0 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build printf 12 | PSSubDir TOP components tools commands printf ; 13 | 14 | # Define local sources 15 | local sources = 16 | PrintfCommand.cpp 17 | ; 18 | 19 | # Build the PRC 20 | local ENTRY = ComponentLibMain ; 21 | local PRCCREATOR = prtf ; 22 | local PRCTYPE = libr ; 23 | PDBNAME on printf.prc = printf ; 24 | 25 | Prc printf.prc : 26 | $(sources) 27 | printf.xrd 28 | 29 | SystemGlue$(SUFLIB) 30 | 31 | CPMLib$(SUFSTUB) 32 | DALLib$(SUFSTUB) 33 | SystemLib$(SUFSTUB) 34 | libbinder$(SUFSTUB) 35 | ; 36 | 37 | 38 | 39 | # Package org.openbinder.tools.commands.Printf : 40 | # ; 41 | -------------------------------------------------------------------------------- /headers/storage/StorageDefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _STORAGE2_DEFS_H 14 | #define _STORAGE2_DEFS_H 15 | 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #if _SUPPORTS_NAMESPACE 24 | namespace palmos { 25 | namespace storage { 26 | 27 | using namespace palmos::support; 28 | 29 | } } // namespace palmos::storage 30 | #endif 31 | 32 | #endif // _STORAGE2_DEFS_H 33 | -------------------------------------------------------------------------------- /interfaces/support/IUuid.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | /*! @file support/IUuid.idl 14 | @ingroup CoreSupportBinder 15 | 16 | @brief Interface to create UUIDs. 17 | */ 18 | 19 | namespace palmos { 20 | namespace support { 21 | 22 | //! Interface to request the creation of UUIDs/GUIDs. 23 | /*! @ingroup CoreSupportBinder */ 24 | interface IUuid 25 | { 26 | methods: 27 | //! Returns a newly created UUID 28 | SValue Create(); 29 | } 30 | 31 | 32 | } } // namespace palmos::support 33 | -------------------------------------------------------------------------------- /tools/pidgen/OutputCPP.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef OUTPUTCPP_H 14 | #define OUTPUTCPP_H 15 | 16 | #include "InterfaceRec.h" 17 | 18 | #include 19 | 20 | #if _SUPPORTS_NAMESPACE 21 | using namespace palmos::support; 22 | #endif 23 | 24 | status_t WriteCPP(sptr stream, SVector &recs, 25 | const SString & filename, 26 | const SString & lHeader, 27 | bool systemHeader); 28 | 29 | 30 | 31 | #endif // OUTPUTCPP_H 32 | -------------------------------------------------------------------------------- /components/tools/BinderShell/Test.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SHELL_TEST_H 14 | #define _SHELL_TEST_H 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | using namespace palmos::app; 21 | #endif 22 | 23 | class Test : public BUnixCommand, public SPackageSptr 24 | { 25 | public: 26 | Test(const SContext&); 27 | 28 | virtual SValue main(int argc, char** argv); 29 | 30 | private: 31 | }; 32 | 33 | #endif // _SHELL_TEST_H 34 | -------------------------------------------------------------------------------- /components/tools/commands/atom/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build atom 12 | PSSubDir TOP components tools commands atom ; 13 | 14 | # Define local sources 15 | local sources = 16 | Atom.cpp 17 | ; 18 | 19 | # Sign the PRC 20 | SignedPrc atom.prc ; 21 | 22 | # Build the PRC 23 | local ENTRY = ComponentLibMain ; 24 | local PRCCREATOR = atom ; 25 | local PRCTYPE = libr ; 26 | PDBNAME on atom.prc = atom ; 27 | 28 | Prc atom.prc : 29 | $(sources) 30 | atom.xrd 31 | 32 | SystemGlue$(SUFLIB) 33 | 34 | DALLib$(SUFSTUB) 35 | SystemLib$(SUFSTUB) 36 | libbinder$(SUFSTUB) 37 | ; 38 | 39 | 40 | 41 | # Package org.openbinder.tools.commands.Atom : 42 | # ; 43 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | CONFIGS:= \ 4 | base_config.txt \ 5 | all_files.txt 6 | 7 | DOXYGEN_CONFIG_FILE:= $(OUT_INTERMEDIATES)/$(LOCAL_PATH)/finalconfig.txt 8 | 9 | $(DOXYGEN_CONFIG_FILE): $(addprefix $(BUILD_SYSTEM)/doxygen/,$(CONFIGS)) 10 | mkdir -p $(dir $(@)) 11 | cat $^ >$@ 12 | 13 | .PHONY: docs 14 | docs:: $(DOXYGEN_CONFIG_FILE) interfaces 15 | mkdir -p $(OUT_DOCS) 16 | cp -rf $(LOCAL_PATH)/raw/* $(OUT_DOCS) 17 | ( \ 18 | export PROJECT_NAME=OpenBinder; \ 19 | export ROOT=$(PWD)/$(TOP); \ 20 | export OUTPUT_DIRECTORY=$(PWD)/$(OUT_DOCS); \ 21 | cd $(BUILD_SYSTEM)/doxygen; \ 22 | $(DOXYGEN) $(PWD)/$< \ 23 | ) 24 | 25 | docs:: LOCAL_PATH:= $(LOCAL_PATH) 26 | 27 | ALL_INTERMEDIATES+= $(DOXYGEN_CONFIG_FILE) 28 | 29 | .PHONY: cleandocs 30 | cleandocs:: 31 | @rm -f $(DOXYGEN_CONFIG_FILE) 32 | @rm -rf $(OUT_DOCS) 33 | 34 | cleandocs:: DOXYGEN_CONFIG_FILE:= $(DOXYGEN_CONFIG_FILE) 35 | 36 | clean:: cleandocs 37 | -------------------------------------------------------------------------------- /interfaces/app/IProgress.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace app { 15 | 16 | interface IProgress 17 | { 18 | methods: 19 | void Finish(status_t err); 20 | 21 | properties: 22 | //! Precentage of the progress done from 0.0 to 1.0 23 | float progress; 24 | //! Note that is displayed on the status dialog 25 | SString note; 26 | //! Whether or not the user pressed the Cancel button 27 | [readonly]bool isCanceled; 28 | } 29 | 30 | } } // namespace palmos::app 31 | -------------------------------------------------------------------------------- /libraries/libdmprovider/libdmprovider.mld: -------------------------------------------------------------------------------- 1 | # By convention, class method names that begin with 2 | # a lower-case letter are generally private, so we don't 3 | # normally export them. 4 | set methodfilter=[^a-z].* 5 | 6 | set namespace=palmos::dmprovider 7 | 8 | set class=BSchemaDatabaseNode 9 | export all 10 | hide function Context 11 | 12 | set class=BSchemaRowIDJoin 13 | export all 14 | hide function Context 15 | set class=BSchemaRowIDJoin::RowNode 16 | export all 17 | hide function Context 18 | set class=BSchemaRowIDJoin::JoinIterator 19 | export all 20 | 21 | set class=BSchemaTableNode 22 | export all 23 | hide function Context 24 | set class=BSchemaTableNode::CustomColumn 25 | export all 26 | hide function Table 27 | set class=BSchemaTableNode::DataAccessor 28 | export all 29 | hide function Table 30 | set class=BSchemaTableNode::RowNode 31 | export all 32 | hide function Context 33 | set class=BSchemaTableNode::QueryIterator 34 | export all 35 | 36 | -------------------------------------------------------------------------------- /tools/pidgen/TypeBank.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef TYPEBANK_H 14 | #define TYPEBANK_H 15 | 16 | #include "idlc.h" 17 | #include "InterfaceRec.h" 18 | //extern SKeyedVector > TypeBank; 19 | 20 | void cleanTypeBank(SKeyedVector >& tb); 21 | status_t initTypeBank(SKeyedVector >& tb); 22 | void checktb (SKeyedVector > tb); 23 | 24 | const SKeyedVector >& getTypeBank(); 25 | 26 | #endif // TYPEBANK_H 27 | -------------------------------------------------------------------------------- /interfaces/app/IApplication.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | import 14 | 15 | namespace palmos { 16 | namespace app { 17 | 18 | interface IApplication 19 | { 20 | methods: 21 | void Start(); 22 | status_t Stop(); // ??? 23 | 24 | // Returns an event_dispatch_result 25 | int32_t DispatchAppEvent(SMessage msg); 26 | 27 | // Stuff for legacy apps. 28 | void DeferredSublaunchReady(); 29 | void NotificationsReady(); 30 | void SublaunchResult(SValue result); 31 | } 32 | 33 | } } // namespace palmos::app 34 | 35 | -------------------------------------------------------------------------------- /interfaces/app/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build app interface files 12 | if ! $(PALMSOURCE_DEV_KIT) { 13 | PSSubDir TOP interfaces PDK app ; 14 | } else { 15 | PSSubDir TOP PDK interfaces app ; 16 | } 17 | 18 | # Build idl-generated files 19 | InterfaceIdl IApplication.cpp : IApplication.idl : libservices ; 20 | InterfaceIdl IApplicationManager.cpp : IApplicationManager.idl : libservices ; 21 | InterfaceIdl ICommand.cpp : ICommand.idl : libbinder ; 22 | InterfaceIdl ITerminalView.cpp : ITerminalView.idl : libbinder ; 23 | InterfaceIdl IProgress.cpp : IProgress.idl : libbinder ; 24 | 25 | # Build the deliverables 26 | if ! $(PALMSOURCE_DEV_KIT) { 27 | PdkFile Jamfile [ Glob $(SUBDIR) : *.idl ] ; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /servers/smooved/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2001-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build smooved 12 | PSSubDir TOP servers smooved ; 13 | 14 | # Define local sources 15 | local sources = 16 | smoove.cpp 17 | ; 18 | 19 | # Set local flags 20 | if $(TARGET_DEVICE) = LINUX_X86 && $(DEBUG) = Debug { 21 | # Building with electric fence slows things down, and we 22 | # don't have an ARM build yet 23 | # LINKFLAGS on smooved += -lefence ; 24 | } 25 | 26 | if $(DISABLE_LIBSEGFAULT) = "" { 27 | LINKFLAGS on smooved += -lSegFault ; 28 | } 29 | LINKFLAGS on smooved += -lc -lpthread -ldl -lrt ; 30 | 31 | # Build the executable 32 | Main smooved : $(sources) ; 33 | LinkLibraries smooved : 34 | libbinder$(SUFSHL) 35 | libbinder_glue$(SUFLIB) 36 | ; 37 | 38 | -------------------------------------------------------------------------------- /components/tools/commands/printf/PrintfCommand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef FORTUNE_COMMAND_H_ 14 | #define FORTUNE_COMMAND_H_ 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | using namespace palmos::app; 21 | #endif 22 | 23 | class BPrintfCommand : public BCommand, private SPackageSptr 24 | { 25 | public: 26 | BPrintfCommand(const SContext& context); 27 | 28 | SValue Run(const SValue& args); 29 | virtual SString Documentation() const; 30 | }; 31 | 32 | #endif // FORTUNE_COMMAND_H_ 33 | -------------------------------------------------------------------------------- /samples/SampleService/ISampleService.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace org { 14 | namespace openbinder { 15 | namespace samples { 16 | 17 | //! This is an example of a Binder interface. 18 | /*! This sample interface contains a simple function that returns an 19 | integer. You can find many other examples of more complex interfaces 20 | in interfaces/PDK/... 21 | */ 22 | interface ISampleService 23 | { 24 | methods: 25 | //! Increment a global variable and return it. 26 | int32_t Test(); 27 | } 28 | 29 | } } } // namespace org::openbinder::samples 30 | -------------------------------------------------------------------------------- /headers/support_p/SignalThreadInit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_SIGNAL_THREAD_INIT_H 14 | #define _SUPPORT_SIGNAL_THREAD_INIT_H 15 | 16 | #if _SUPPORTS_NAMESPACE 17 | namespace palmos { 18 | namespace support { 19 | #endif 20 | 21 | class SignalHandlerStaticInit 22 | { 23 | public: 24 | SignalHandlerStaticInit(); 25 | ~SignalHandlerStaticInit(); 26 | 27 | }; 28 | 29 | extern SignalHandlerStaticInit g_signalHandlerStaticInit; 30 | 31 | #if _SUPPORTS_NAMESPACE 32 | } } // namespace palmos::support 33 | #endif 34 | 35 | #endif /* _SUPPORT_SIGNAL_HANDLER_H */ 36 | 37 | -------------------------------------------------------------------------------- /samples/ServiceProcess/Service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef SERVICE_H 14 | #define SERVICE_H 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #if _SUPPORTS_NAMESPACE 21 | using namespace vendor::sample; 22 | #endif 23 | 24 | class Service : public BCatalog, public SPackageSptr 25 | { 26 | public: 27 | Service(const SContext& context, 28 | const SValue &attr); 29 | 30 | protected: 31 | virtual ~Service(); 32 | virtual void InitAtom(); 33 | }; 34 | 35 | 36 | #endif // SERVICE_H 37 | -------------------------------------------------------------------------------- /headers/libpalmroot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef PSI_PALMOS_LIBPALMROOT_H_ 14 | #define PSI_PALMOS_LIBPALMROOT_H_ 15 | 16 | // Include elementary types 17 | #include // Basic types 18 | 19 | #include // strlcat, strlcpy 20 | 21 | #ifdef __cplusplus 22 | // Pure C++ routines 23 | 24 | namespace palmos { 25 | 26 | extern void clock_timespec_add_nano(struct timespec * t, nsecs_t adj); 27 | extern void clock_timespec_from_nano(struct timespec * t, nsecs_t desired); 28 | 29 | } 30 | 31 | #endif 32 | 33 | 34 | #endif // PSI_PALMOS_LIBPALMROOT_H_ 35 | 36 | -------------------------------------------------------------------------------- /tools/pidgen/OutputI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef OUTPUT_I_H 14 | #define OUTPUT_I_H 15 | 16 | #include "InterfaceRec.h" 17 | 18 | #include 19 | 20 | #if _SUPPORTS_NAMESPACE 21 | using namespace palmos::support; 22 | #endif 23 | 24 | /*! 25 | any non alpha filename chars are turned to _ 26 | */ 27 | status_t WriteIHeader(sptr stream, SVector &recs, 28 | const SString &filename, SVector & headers, 29 | const sptr& beginComments, 30 | const sptr& endComments, 31 | bool system); 32 | 33 | #endif // OUTPUT_I_H 34 | -------------------------------------------------------------------------------- /headers/xml/Tag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef XML_TAG_H 14 | #define XML_TAG_H 15 | 16 | #include 17 | 18 | #if _SUPPORTS_NAMESPACE 19 | namespace palmos { 20 | namespace xml { 21 | using namespace support; 22 | #endif 23 | 24 | class SXMLTag 25 | { 26 | public: 27 | SXMLTag(); 28 | SXMLTag(const SString& tag); 29 | SXMLTag(const SXMLTag& tag); 30 | 31 | SString Namespace(); 32 | SString Accessor(); 33 | private: 34 | void split(const SString& tag); 35 | 36 | SString m_namespace; 37 | SString m_accessor; 38 | }; 39 | 40 | #if _SUPPORTS_NAMESPACE 41 | } } 42 | #endif 43 | 44 | #endif // XML_TAG_H 45 | -------------------------------------------------------------------------------- /interfaces/support/ISelector.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | /*! @file support/ISelector.idl 14 | @ingroup CoreSupportBinder 15 | @brief Watch data change. 16 | */ 17 | 18 | namespace palmos { 19 | namespace support { 20 | 21 | //! Watch data change. 22 | /*! @ingroup CoreSupportBinder */ 23 | interface ISelector 24 | { 25 | methods: 26 | status_t Register(SValue key, IBinder binder, SValue property, [optional]uint32_t flags); 27 | status_t Unregister(SValue key, IBinder binder, SValue property, [optional]uint32_t flags); 28 | 29 | properties: 30 | SValue value; 31 | } 32 | 33 | /*! @} */ 34 | 35 | } } // namespace palmos::support 36 | -------------------------------------------------------------------------------- /samples/ShellService/ShellService.bsh: -------------------------------------------------------------------------------- 1 | # This is a Binder Shell script that implements 2 | # a Binder component. 3 | 4 | # We will be implementing the ISampleService 5 | # interface that is defined in SampleService/ISampleService.idl. 6 | # Setting this environment variable tells the BinderShell 7 | # VM which interfaces the script is implementing (set it to 8 | # a "set" if you are implementing more than one). 9 | 10 | INTERFACE=org.openbinder.samples.ISampleService 11 | 12 | # By default others are allowed direct access to 13 | # our properties. Implementing these two methods allows 14 | # us complete control over what external clients can see. 15 | 16 | function __get__() { 17 | return @{undef} 18 | } 19 | 20 | function __set__() { 21 | return @{undef} 22 | } 23 | 24 | # This is a global variable containing our state. 25 | # Use the "start" argument, if it was supplied. 26 | 27 | if [ "$start" = "" ]; then 28 | gIndex=20 29 | else 30 | gIndex=$start 31 | fi 32 | 33 | # Implement the ISampleService::Test() method. 34 | 35 | function Test() { 36 | gIndex=$((gIndex+100)) 37 | return $gIndex 38 | } 39 | -------------------------------------------------------------------------------- /components/tools/BinderShell/vm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef VM_H 14 | #define VM_H 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | using namespace palmos::support; 21 | #endif 22 | 23 | class VirtualMachine : public BnVirtualMachine, public SPackageSptr 24 | { 25 | public: 26 | VirtualMachine(const SContext &context); 27 | 28 | virtual void Init(); 29 | virtual sptr InstantiateComponent(const SValue& componentInfo, 30 | const SString& component, 31 | const SValue& args, 32 | status_t* outError = NULL); 33 | }; 34 | 35 | 36 | #endif // VM_H 37 | -------------------------------------------------------------------------------- /headers/xml/Value2XML.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _VALUE_TO_XML_H 14 | 15 | #define _VALUE_TO_XML_H 16 | 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | namespace palmos { 21 | namespace xml { 22 | #endif 23 | 24 | status_t ValueToXML (const BNS(::palmos::support::)sptr& stream, 25 | const BNS(palmos::support::) SValue &value); 26 | 27 | status_t XMLToValue (const BNS(::palmos::support::)sptr& stream, 28 | BNS(palmos::support::) SValue &value); 29 | 30 | #if _SUPPORTS_NAMESPACE 31 | } } // palmos::xml 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /components/services/base/Uuid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _UUID_H 14 | #define _UUID_H 15 | 16 | #include 17 | #include 18 | 19 | class BUuid : public BnUuid, private SPackageSptr 20 | { 21 | public: 22 | BUuid(const SContext& context); 23 | 24 | virtual void InitAtom(); 25 | virtual SValue Create(); 26 | 27 | private: 28 | struct state 29 | { 30 | uint64_t timestamp; /* saved timestamp */ 31 | char node[6]; /* saved node ID */ 32 | uint16_t clockseq; /* saved clock sequence */ 33 | }; 34 | 35 | SLocker m_lock; 36 | state m_state; 37 | uint64_t m_nextSave; 38 | }; 39 | 40 | #endif // _UUID_H 41 | -------------------------------------------------------------------------------- /interfaces/support/IVirtualMachine.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | /*! @file support/IVirtualMachine.idl 14 | @ingroup CoreSupportBinder 15 | 16 | @brief Binder virtual machine interface. 17 | */ 18 | 19 | namespace palmos { 20 | namespace support { 21 | 22 | //! Virtual machines implement this interface to generate their components. 23 | /*! @ingroup CoreSupportBinder */ 24 | interface IVirtualMachine 25 | { 26 | methods: 27 | void Init(); 28 | IBinder InstantiateComponent( SValue componentInfo, 29 | SString component, 30 | SValue args, 31 | [optional out]status_t outError); 32 | } 33 | 34 | } } // namespace palmos::support 35 | -------------------------------------------------------------------------------- /servers/binderproc/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | int main(int argc, char* argv[]) 20 | { 21 | //openlog("binderproc", LOG_PERROR | LOG_NDELAY, LOG_USER); 22 | bout << "START: binderproc #" << SysProcessID() << " " << (argc > 1 ? argv[1] : "(unnamed)") << endl; 23 | SLooper* loop = SLooper::This(); 24 | sptr proc(loop->Process()); 25 | loop->SendRootObject(proc->AsBinder()); 26 | loop->Loop(true); 27 | bout << "EXIT: binderproc #" << SysProcessID() << " " << (argc > 1 ? argv[1] : "(unnamed)") << endl; 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /components/services/TokenSource/main_token_source.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | class TS : public BTokenSource, public SPackageSptr 18 | { 19 | public: 20 | TS(const SContext& context, const SValue& args) 21 | :BTokenSource(context, args), SPackageSptr() 22 | { 23 | } 24 | }; 25 | 26 | sptr InstantiateComponent( const SString& component, 27 | const SContext& context, 28 | const SValue& args) 29 | { 30 | if (component == "") { 31 | return (BnCatalog*) new TS(context, args); 32 | } 33 | else { 34 | return NULL; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /headers/support_p/BinderGlue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | namespace palmos { 18 | namespace support { 19 | 20 | // This is the pointer to the BSharedObject created for the 21 | // local shared library. 22 | // Note that we MUST only hold a weak reference on it here, 23 | // or else we would never allow the library to be unloaded. 24 | extern SLocker __attribute__ ((visibility("hidden"))) g_sharedObjectLock; 25 | extern wptr __attribute__ ((visibility("hidden"))) g_sharedObject; 26 | extern volatile int32_t __attribute__ ((visibility("hidden"))) g_pendingBufferRef; 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tools/pidgen/pidgenfiles/ICommand.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | import 17 | 18 | } } // namespace palmos::support 19 | 20 | namespace palmos { 21 | namespace app { 22 | 23 | interface ICommand 24 | { 25 | methods: 26 | BValue Run([in]BValue args); 27 | ICommand Spawn([inout]BString command); 28 | void SetProperty([out]BValue key, [inout]BValue value); 29 | BValue GetProperty(BValue key); 30 | 31 | void SetEnvironment(BValue env); 32 | void SetFileDescriptors(BValue fds); 33 | 34 | properties: 35 | IByteInput ByteInput; 36 | IByteOutput ByteOutput; 37 | IByteOutput ByteError; 38 | } 39 | 40 | } } // namespace palmos::app 41 | -------------------------------------------------------------------------------- /samples/ServiceProcess/ServiceCommand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef SERVICE_COMMAND_H 14 | #define SERVICE_COMMAND_H 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | using namespace palmos::support; 21 | using namespace palmos::app; 22 | #endif 23 | 24 | class ServiceCommand : public BCommand, public SPackageSptr 25 | { 26 | public: 27 | ServiceCommand( const SContext& context, 28 | const SValue &attr); 29 | 30 | virtual SValue Run(const ArgList& args); 31 | virtual SString Documentation() const; 32 | 33 | protected: 34 | virtual ~ServiceCommand(); 35 | }; 36 | 37 | 38 | #endif // SERVICE_COMMAND_H 39 | -------------------------------------------------------------------------------- /components/tools/commands/fortune/FortuneCommand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef FORTUNE_COMMAND_H_ 14 | #define FORTUNE_COMMAND_H_ 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | using namespace palmos::app; 21 | #endif 22 | 23 | class BFortune : public BCommand, private SPackageSptr 24 | { 25 | public: 26 | BFortune(const SContext& context); 27 | 28 | SValue Run(const SValue& args); 29 | virtual SString Documentation() const; 30 | 31 | static int32_t const kRandomFortune = -1; 32 | 33 | protected: 34 | SString GetFortuneFromFile(SString filename, 35 | int32_t selectedFortune=kRandomFortune); 36 | 37 | }; 38 | 39 | #endif // FORTUNE_COMMAND_H_ 40 | -------------------------------------------------------------------------------- /headers/xml/StringUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _B_XML2_STRINGUTILS_H 14 | #define _B_XML2_STRINGUTILS_H 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #if _SUPPORTS_NAMESPACE 21 | namespace palmos { 22 | namespace xml { 23 | using namespace support; 24 | #endif 25 | 26 | // Functions 27 | // ===================================================================== 28 | // Functions that do some fun stuff to strings 29 | bool SplitStringOnWhitespace(const SString & str, SString & split, int32_t * pos); 30 | 31 | #if _SUPPORTS_NAMESPACE 32 | }; // namespace xml 33 | }; // namespace palmos 34 | #endif 35 | 36 | #endif // _B_XML2_STRINGUTILS_H 37 | -------------------------------------------------------------------------------- /headers/package/PackageKit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _PACKAGE_KIT_H 14 | #define _PACKAGE_KIT_H 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | namespace palmos { 21 | namespace package { 22 | using namespace palmos::storage; 23 | using namespace palmos::support; 24 | #endif 25 | 26 | // Returns an SValue given a component description (from the manifest) 27 | // using the standard names: 28 | // Key Type 29 | // file string Path to the script file 30 | sptr get_script_data_from_value(const SValue &info, status_t *err = NULL); 31 | 32 | 33 | #if _SUPPORTS_NAMESPACE 34 | } } 35 | #endif 36 | 37 | #endif // _PACKAGE_KIT_H 38 | -------------------------------------------------------------------------------- /headers/xml_p/parsing.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _PARSING_P_H 14 | #define _PARSING_P_H 15 | 16 | #include 17 | 18 | #if _SUPPORTS_NAMESPACE 19 | namespace palmos { 20 | namespace xml { 21 | #endif 22 | 23 | // extern palmos::xml::BXMLObjectFactory be_default_xml_factory; 24 | 25 | // This function does the parsing 26 | // All the public xml parsing functinons, as well as some of the stuff in the entity handling 27 | // uses this directly. 28 | // Defined ParseXML.cpp 29 | status_t _do_the_parsing_yo_(BXMLDataSource * data, BXMLParseContext * context, bool dtdOnly, uint32_t flags); 30 | 31 | #if _SUPPORTS_NAMESPACE 32 | }; // namespace xml 33 | }; // namespace palmos 34 | #endif 35 | 36 | #endif // _PARSING_P_H 37 | -------------------------------------------------------------------------------- /components/services/base/main_base.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include "Informant.h" 14 | #include 15 | #include 16 | 17 | // ----------------------------------------------------------------- 18 | 19 | // Given a component name 20 | // and the context it is being instantiated in, return the 21 | // IBinder for a new instance of the component. The "context" 22 | // is the IContext in which this new component is to be running 23 | // in. 24 | sptr InstantiateComponent( const SString& component, 25 | const SContext& context, 26 | const SValue &args) 27 | { 28 | if (component == "Informant") { 29 | return new Informant(context); 30 | } 31 | 32 | return NULL; 33 | } 34 | -------------------------------------------------------------------------------- /samples/SampleComponent/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build SampleComponent 12 | PSSubDir TOP samples SampleComponent ; 13 | 14 | # Set local vars 15 | local CREATOR = cmex ; 16 | local TYPE = libr ; 17 | local PDBNAME = Sample_Component ; 18 | local PKGNAME = vendor.samples.SampleComponent ; 19 | 20 | # Define local sources 21 | local sources = 22 | SampleComponent.cpp 23 | main_samplecomponent.cpp 24 | ; 25 | 26 | # Localized resources 27 | #OverlayPrc Sample_Component ; 28 | 29 | # Build the component 30 | Component Sample_Component.prc : 31 | SampleComponent.xrd 32 | 33 | $(sources) 34 | ; 35 | 36 | # Build the deliverables 37 | if ! $(PALMSOURCE_DEV_KIT) 38 | { 39 | local hdrfiles = [ Glob $(SUBDIR) : *.h ] ; 40 | PdkFile 41 | $(sources) 42 | $(hdrfiles) 43 | README.txt 44 | Manifest.xml 45 | Jamfile 46 | : 47 | [ FDirName $(BUILD_DIR) PDK samples SampleComponent ] 48 | ; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /interfaces/support/IByteStream.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | /* NOTE: 17 | These interfaces are custom-written for C++. Look in the C++ 18 | header support/IByteStream.h for the C++ API. 19 | */ 20 | 21 | interface IByteInput 22 | { 23 | methods: 24 | ssize_t Read([out]SValue buffer, size_t size, [optional]uint32_t flags); 25 | } 26 | 27 | interface IByteOutput 28 | { 29 | methods: 30 | ssize_t Write(SValue buffer, size_t size, [optional]uint32_t flags); 31 | 32 | status_t Sync(); 33 | } 34 | 35 | interface IByteSeekable 36 | { 37 | methods: 38 | off_t Seek(off_t position, uint32_t seek_mode); 39 | 40 | properties: 41 | [readonly]off_t position; 42 | } 43 | 44 | } } // namespace palmos::support -------------------------------------------------------------------------------- /headers/support/TLS.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _TLS_H 14 | #define _TLS_H 1 15 | 16 | #include 17 | 18 | #include 19 | 20 | // KILL THIS FILE PLEASE! 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | // 27 | 28 | static inline int32_t tls_allocate() 29 | { 30 | int32_t index = -1; 31 | SysTSDAllocate((SysTSDSlotID*)&index, NULL, sysTSDAnonymous); 32 | return index; 33 | } 34 | 35 | static inline void* tls_get(int32_t index) 36 | { 37 | return SysTSDGet((SysTSDSlotID)index); 38 | } 39 | 40 | static inline void tls_set(int32_t index, void *value) 41 | { 42 | SysTSDSet((SysTSDSlotID)index, value); 43 | } 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /docs/Authors.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @page Authors Authors 3 | 4 |
5 |
\< @ref Contents | @ref OpenBinder | @ref MissingFeatures \>
6 |
7 |
8 | 9 | Kenneth Albanowski (kenneth.albanowski@palmsource.com): Port of user-space 10 | code to Linux. 11 | 12 | Trey Boudreau (trey.boudrea@palmsource.com): Linux Binder module, 13 | IMemory, Memory Dealer. 14 | 15 | John Dance (dance@acm.org): Marshalling and pidgen, BCatalogMirror. 16 | 17 | Dianne Hackborn (hackbod@angryredplanet.com): General design, support 18 | classes, SValue, SLocker and SAtom debugging, data model, documentation. 19 | 20 | Arve Hjønnevåg (arve.hjonnevag@palmsource.com): Binder kernel module 21 | (versions 2 and 4). 22 | 23 | George Hoffman (geh@georgeandjulia.com): Initial design and implementation, 24 | especially of IBinder/BBinder, the Binder kernel module, gehnaphores 25 | (lightweight locks), SAtom, SHandler. 26 | 27 | Joe Onorato (joeo@onorato.org): General design, XML parser, BBinder, 28 | marshalling and pidgen. 29 | 30 | Jason Parks (jason.parks@palmsource.com): Package manager, settings 31 | catalog, Binder Shell, data model, port to Linux. 32 | 33 | Jenny Tsai (jitsai@alumni.uchicago.edu): Pidgen. 34 | 35 | */ 36 | -------------------------------------------------------------------------------- /samples/SampleComponent/main_samplecomponent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include "SampleComponent.h" 14 | #include 15 | #include 16 | 17 | // ----------------------------------------------------------------- 18 | 19 | // Given a component name 20 | // and the context it is being instantiated in, return the 21 | // IBinder for a new instance of the component. The "context" 22 | // is the IContext in which this new component is to be running 23 | // in. 24 | sptr InstantiateComponent( const SString& component, 25 | const SContext& context, 26 | const SValue & args) 27 | { 28 | if (component == "") 29 | { 30 | return new SampleComponent(context, args); 31 | } 32 | 33 | return NULL; 34 | } 35 | -------------------------------------------------------------------------------- /samples/SampleService/SampleService_components.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include "SampleService.h" 14 | 15 | #include 16 | 17 | // ----------------------------------------------------------------- 18 | 19 | // Given a component name 20 | // and the context it is being instantiated in, return the 21 | // IBinder for a new instance of the component. The "context" 22 | // is the IContext in which this new component is to be running 23 | // in. 24 | sptr InstantiateComponent( const SString& component, 25 | const SContext& context, 26 | const SValue &args) 27 | { 28 | if (component == "") 29 | { 30 | return static_cast(new SampleService(context, args)); 31 | } 32 | 33 | return NULL; 34 | } 35 | -------------------------------------------------------------------------------- /samples/SampleService/SampleService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef SAMPLE_SERVICE_H 14 | #define SAMPLE_SERVICE_H 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | #if _SUPPORTS_NAMESPACE 22 | using namespace vendor::sample; 23 | #endif 24 | 25 | class SampleService : public BnSampleService, public SPackageSptr 26 | { 27 | public: 28 | SampleService( const SContext& context, 29 | const SValue &attr); 30 | 31 | // ISampleService 32 | virtual int32_t Test(); 33 | 34 | protected: 35 | virtual ~SampleService(); 36 | virtual void InitAtom(); 37 | 38 | private: 39 | SLocker m_lock; 40 | 41 | int32_t m_count; 42 | bool m_countSupplied; 43 | }; 44 | 45 | 46 | #endif // HARD_INPUT_VIEW_H 47 | -------------------------------------------------------------------------------- /tools/pidgen/SearchPath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef SEARCHPATH_H 14 | #define SEARCHPATH_H 15 | 16 | #include 17 | #include 18 | 19 | using namespace palmos::support; 20 | 21 | class SearchPath 22 | { 23 | public: 24 | /*! 25 | Add a path to the search path. If it's an absolute 26 | path, great. If it's relative, it's relative to the 27 | current working directory. 28 | */ 29 | void AddPath(const SString &path); 30 | 31 | /*! 32 | Find file, inside the search path, return 33 | the value in path. Absolute paths just return the 34 | path and B_OK; 35 | */ 36 | /*status_t FindFullPath(const SString &file, SString &path);*/ 37 | 38 | private: 39 | SVector m_paths; 40 | }; 41 | 42 | extern SearchPath gSearchPath; 43 | 44 | #endif // SEARCHPATH_H 45 | -------------------------------------------------------------------------------- /headers/xml/XMLOStr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _XML2_XMLOSTR_H 14 | #define _XML2_XMLOSTR_H 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | namespace palmos { 21 | namespace xml { 22 | using namespace support; 23 | #endif 24 | 25 | /**************************************************************************************/ 26 | 27 | class CXMLOStr : public BnInterface 28 | { 29 | public: 30 | CXMLOStr(); 31 | virtual ~CXMLOStr(); 32 | 33 | virtual status_t Told(SValue &in); 34 | 35 | private: 36 | CXMLOStr(const CXMLOStr& o); 37 | }; 38 | 39 | /**************************************************************************************/ 40 | 41 | #if _SUPPORTS_NAMESPACE 42 | } } // namespace palmos::xml 43 | #endif 44 | 45 | #endif // _B_XML2_PARSER_H 46 | -------------------------------------------------------------------------------- /samples/SampleComponent/SampleComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef SAMPLE_COMPONENT_H 14 | #define SAMPLE_COMPONENT_H 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | using namespace palmos::support; 21 | using namespace palmos::app; 22 | #endif 23 | 24 | // Demonstrates basic a basic component. 25 | // 26 | // This component implements the ICommand interface so you 27 | // can use it from the shell. 28 | 29 | class SampleComponent : public BCommand, public SPackageSptr 30 | { 31 | public: 32 | SampleComponent( const SContext& context, 33 | const SValue &attr); 34 | 35 | virtual SValue Run(const ArgList& args); 36 | virtual SString Documentation() const; 37 | 38 | protected: 39 | virtual ~SampleComponent(); 40 | }; 41 | 42 | 43 | #endif // SAMPLE_COMPONENT_H 44 | -------------------------------------------------------------------------------- /headers/support_p/IntrusiveProfiler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_P_INTRUSIVE_PROFILER_H 14 | #define _SUPPORT_P_INTRUSIVE_PROFILER_H 15 | 16 | #include 17 | #include 18 | 19 | struct DProfileTarget { 20 | nsecs_t time; 21 | uint32_t hits; 22 | char const * const target; 23 | DProfileTarget(char const * const t); 24 | ~DProfileTarget(); 25 | void Stats(void); 26 | }; 27 | 28 | class DAutoProfile { 29 | nsecs_t start; 30 | DProfileTarget ⌖ 31 | public: 32 | DAutoProfile(DProfileTarget &dpt); 33 | ~DAutoProfile(); 34 | }; 35 | 36 | #if !defined(INTRUSIVE_PROFILING) 37 | #define INTRUSIVE_PROFILING 0 38 | #endif 39 | 40 | #if INTRUSIVE_PROFILING > 0 41 | #define DPT(x) static DProfileTarget dg_ ## x (# x) 42 | #define DAP(x) DAutoProfile _dap(dg_ ## x) 43 | #else 44 | #define DPT(x) 45 | #define DAP(x) 46 | #endif 47 | #endif 48 | -------------------------------------------------------------------------------- /libraries/libbinder/support/KeyID.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | //#define DEBUG 1 14 | #include 15 | #include 16 | #if DEBUG 17 | #include 18 | #endif 19 | 20 | BNS(namespace palmos {) 21 | BNS(namespace support {) 22 | 23 | SKeyID::SKeyID(KeyID id, FreeKey* cleanup) 24 | : SAtom(), m_key(id), m_cleanup(cleanup) 25 | { 26 | #if DEBUG 27 | bout << SPrintf("SKeyID(%8lx)", m_key) << endl; 28 | #endif 29 | } 30 | 31 | SKeyID::~SKeyID() 32 | { 33 | #if DEBUG 34 | bout << SPrintf("~SKeyID(%8lx)", m_key) << endl; 35 | #endif 36 | if (m_cleanup) 37 | { 38 | (*m_cleanup)(m_key); 39 | delete m_cleanup; 40 | } 41 | } 42 | 43 | KeyID 44 | SKeyID::AsKeyID() 45 | { 46 | return m_key; 47 | } 48 | 49 | SKeyID::FreeKey::FreeKey() 50 | { 51 | } 52 | 53 | SKeyID::FreeKey::~FreeKey() 54 | { 55 | } 56 | 57 | BNS(} }) // palmos::support 58 | -------------------------------------------------------------------------------- /components/tools/BinderShell/ANSIEscapes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef ANSIESCAPES_H_ 14 | #define ANSIESCAPES_H_ 15 | 16 | #define ANSI_NORMAL "\033[00m" 17 | #define ANSI_BLACK "\033[0;30m" 18 | #define ANSI_BLUE "\033[0;34m" 19 | #define ANSI_GREEN "\033[0;32m" 20 | #define ANSI_CYAN "\033[0;36m" 21 | #define ANSI_RED "\033[0;31m" 22 | #define ANSI_PURPLE "\033[0;35m" 23 | #define ANSI_BROWN "\033[0;33m" 24 | #define ANSI_GRAY "\033[0;37m" 25 | #define ANSI_DARK_GRAY "\033[1;30m" 26 | #define ANSI_LIGHT_BLUE "\033[1;34m" 27 | #define ANSI_LIGHT_GREEN "\033[1;32m" 28 | #define ANSI_LIGHT_CYAN "\033[1;36m" 29 | #define ANSI_LIGHT_RED "\033[1;31m" 30 | #define ANSI_LIGHT_PURPLE "\033[1;35m" 31 | #define ANSI_YELLOW "\033[1;33m" 32 | #define ANSI_WHITE "\033[1;37m" 33 | 34 | #define COLOR(_c_, _s_) ANSI_##_c_ _s_ ANSI_NORMAL 35 | 36 | #endif // ANSIESCAPES_H_ 37 | -------------------------------------------------------------------------------- /interfaces/app/ICommand.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | import 14 | 15 | namespace palmos { 16 | namespace app { 17 | 18 | interface ICommand 19 | { 20 | typedef sequence ArgList; 21 | 22 | methods: 23 | SValue Run(ArgList args); 24 | ICommand Spawn(SString command) const; 25 | void SetProperty(SValue key, SValue value); 26 | SValue GetProperty(SValue key) const; 27 | void RemoveProperty(SValue key); 28 | 29 | void SetFileDescriptors(SValue fds); 30 | 31 | void AddCommand(SString name, ICommand command); 32 | ICommand GetCommand(SString name) const; 33 | void RemoveCommand(SString name); 34 | 35 | properties: 36 | IByteInput byteInput; 37 | IByteOutput byteOutput; 38 | IByteOutput byteError; 39 | SValue environment; 40 | [readonly]SString documentation; 41 | } 42 | 43 | } } // namespace palmos::app 44 | -------------------------------------------------------------------------------- /samples/ServiceProcess/main_serviceprocess.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include "Service.h" 14 | #include "ServiceCommand.h" 15 | 16 | #include 17 | 18 | // ----------------------------------------------------------------- 19 | 20 | // Given a component name 21 | // and the context it is being instantiated in, return the 22 | // IBinder for a new instance of the component. The "context" 23 | // is the IContext in which this new component is to be running 24 | // in. 25 | sptr InstantiateComponent( const SString& component, 26 | const SContext& context, 27 | const SValue &args) 28 | { 29 | if (component == "") 30 | { 31 | return static_cast(new Service(context, args)); 32 | } 33 | else if (component == "Command") 34 | { 35 | return static_cast(new ServiceCommand(context, args)); 36 | } 37 | 38 | return NULL; 39 | } 40 | -------------------------------------------------------------------------------- /libraries/libbinder/xml/Tag.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #if _SUPPORTS_NAMESPACE 17 | using namespace palmos::xml; 18 | #endif 19 | 20 | SXMLTag::SXMLTag() 21 | { 22 | } 23 | 24 | SXMLTag::SXMLTag(const SString& tag) 25 | { 26 | split(tag); 27 | } 28 | 29 | SXMLTag::SXMLTag(const SXMLTag& tag) 30 | : m_namespace(tag.m_namespace), 31 | m_accessor(tag.m_accessor) 32 | { 33 | } 34 | 35 | void SXMLTag::split(const SString& tag) 36 | { 37 | int32_t colon = tag.FindFirst(":"); 38 | if (colon > 0) 39 | { 40 | tag.CopyInto(m_namespace, 0, colon); 41 | tag.CopyInto(m_accessor, colon + 1, tag.Length() - colon - 1); 42 | } 43 | else 44 | { 45 | m_namespace = ""; 46 | m_accessor = tag; 47 | } 48 | } 49 | 50 | SString SXMLTag::Namespace() 51 | { 52 | return m_namespace; 53 | } 54 | 55 | SString SXMLTag::Accessor() 56 | { 57 | return m_accessor; 58 | } 59 | -------------------------------------------------------------------------------- /libraries/libbinder/xml/DataSource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #if _SUPPORTS_NAMESPACE 17 | namespace palmos { 18 | namespace xml { 19 | #endif 20 | 21 | 22 | // ===================================================================== 23 | BXMLDataSource::~BXMLDataSource() 24 | { 25 | } 26 | 27 | 28 | // ===================================================================== 29 | BXMLfstreamSource::BXMLfstreamSource(FILE *file) 30 | :m_file(file) 31 | { 32 | } 33 | 34 | BXMLfstreamSource::~BXMLfstreamSource() 35 | { 36 | } 37 | 38 | status_t 39 | BXMLfstreamSource::GetNextBuffer(size_t *size, uint8_t **data, int *done) 40 | { 41 | if (m_file == NULL) return B_NO_INIT; 42 | *size = fread(*data, 1, *size, m_file); 43 | *done = feof(m_file); 44 | return ferror(m_file); 45 | } 46 | 47 | 48 | #if _SUPPORTS_NAMESPACE 49 | }; // namespace xml 50 | }; // namespace palmos 51 | #endif 52 | -------------------------------------------------------------------------------- /headers/support/SwappedValue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_SWAPPED_VALUE_H 14 | #define _SUPPORT_SWAPPED_VALUE_H 15 | 16 | /*! @file support/SwappedValue.h 17 | @ingroup CoreSupportUtilities 18 | @brief Add data to a value that is tagged with endianness 19 | and pull it out and know if you need to swap. 20 | */ 21 | 22 | #include 23 | 24 | #if _SUPPORTS_NAMESPACE 25 | namespace palmos { 26 | namespace support { 27 | #endif 28 | 29 | /*! @addtogroup CoreSupportUtilities 30 | @{ 31 | */ 32 | 33 | // returns a SValue that is the data and an endianness 34 | status_t create_swappable_value(uint32_t typeCode, void *data, size_t size, SValue *value); 35 | 36 | // returns whether you should swap or not 37 | bool get_swappable_data(const SValue &value, void **data, size_t *size); 38 | 39 | /*! @} */ 40 | 41 | #if _SUPPORTS_NAMESPACE 42 | } } // namespace palmos::render 43 | #endif 44 | 45 | #endif // _SUPPORT_SWAPPED_VALUE_H 46 | -------------------------------------------------------------------------------- /interfaces/support/INodeObserver.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | /*! @file support/INodeObserver.idl 14 | @ingroup CoreSupportDataModel 15 | 16 | @brief Convenience for linking to INode events. 17 | */ 18 | 19 | import 20 | 21 | namespace palmos { 22 | namespace support { 23 | 24 | //! Convenience for linking to INode events. 25 | /*! @ingroup CoreSupportDataModel */ 26 | interface INodeObserver 27 | { 28 | methods: 29 | //! See INode::NodeChanged. 30 | void NodeChanged(INode who, uint32_t flags, SValue hints); 31 | 32 | //! See INode::EntryCreated. 33 | void EntryCreated(INode node, SString name, IBinder entry); 34 | 35 | //! See INode::EntryModified. 36 | void EntryModified(INode node, SString name, IBinder entry); 37 | 38 | //! See INode::EntryRemoved. 39 | void EntryRemoved(INode node, SString name); 40 | 41 | //! See INode::EntryRenamed. 42 | void EntryRenamed(INode node, SString old_name, SString new_name, IBinder entry); 43 | } 44 | 45 | 46 | } } // namespace palmos::support 47 | -------------------------------------------------------------------------------- /libraries/libbinder/storage/StructuredNode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | 15 | BStructuredNode::BStructuredNode(const SContext &context, const char **entries, size_t entryCount, uint32_t mode) 16 | : BIndexedDataNode(context, mode) 17 | , m_entries(entries) 18 | , m_entryCount(entryCount) 19 | { 20 | } 21 | 22 | BStructuredNode::~BStructuredNode() 23 | { 24 | } 25 | 26 | ssize_t BStructuredNode::EntryIndexOfLocked(const SString& entry) const 27 | { 28 | const size_t N = m_entryCount; 29 | for (size_t i=0; i 22 | #include 23 | 24 | #include 25 | 26 | #if _SUPPORTS_NAMESPACE 27 | namespace palmos { 28 | namespace support { 29 | #endif 30 | 31 | /*! @addtogroup CoreSupportUtilities 32 | @{ 33 | */ 34 | 35 | class SEventFlag 36 | { 37 | public: 38 | SEventFlag(); 39 | ~SEventFlag(); // dtor not virtal 40 | 41 | status_t Set(); 42 | status_t Clear(); 43 | status_t Wait(nsecs_t timeout = -1); 44 | 45 | private: 46 | explicit SEventFlag(const SEventFlag &o); 47 | 48 | uint32_t m_bits; 49 | pthread_cond_t m_cond; 50 | pthread_mutex_t m_mutex; 51 | }; 52 | 53 | /*! @} */ 54 | 55 | #if _SUPPORTS_NAMESPACE 56 | } } // namespace palmos::support 57 | #endif 58 | 59 | #endif // _SUPPORT_EVENT_FLAG_H 60 | -------------------------------------------------------------------------------- /headers/xml/IXMLOStr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _XML2_IXMLOSTR_H 14 | #define _XML2_IXMLOSTR_H 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | namespace palmos { 21 | namespace xml { 22 | using namespace support; 23 | #endif 24 | 25 | /**************************************************************************************/ 26 | 27 | class IXMLOStr : public IInterface 28 | { 29 | public: 30 | 31 | //the following could be B_DECLARE_META_INTERFACE(), but we've no RXMLOStr 32 | B_DECLARE_META_INTERFACE(XMLOStr) 33 | 34 | virtual status_t StartTag(SString &name, SValue &attributes) = 0; 35 | virtual status_t EndTag(SString &name) = 0; 36 | virtual status_t Content(const char *data, int32_t size) = 0; 37 | virtual status_t Comment(const char *data, int32_t size); 38 | }; 39 | 40 | /**************************************************************************************/ 41 | 42 | #if _SUPPORTS_NAMESPACE 43 | } } // namespace palmos::xml 44 | #endif 45 | 46 | #endif /* _XML2_XMLOSTR_H */ 47 | -------------------------------------------------------------------------------- /tools/pidgen/README: -------------------------------------------------------------------------------- 1 | 2 | Note, the error text that gets printed when you 3 | have bad arguments is wrong. There is little to 4 | no helpful debugging information printed, and 5 | if you don't follow these guidelines, undefined 6 | things happen. 7 | 8 | 9 | These are the usages: 10 | 11 | 12 | To get dependencies: 13 | 14 | idlc --deps --output OUTPUTDIR IDLFILE 15 | 16 | Note, the files printed as depenencies are not 17 | the correct files for dependencies. I'm checking 18 | it in incorrect so that Steven can put it into 19 | BOBS. 20 | 21 | 22 | To generate-o-rama: 23 | 24 | idlc INCLUDES [--system] [--output DIR] IDLFILE 25 | 26 | INCLUDES is zero or more of: 27 | -I 28 | There is no space between the I. 29 | The current directory is implicitly in the list. 30 | This might change. Specify full path names here 31 | for best results. 32 | 33 | [--system] 34 | Optional. Causes it to generate system headers 35 | (i.e. uses '<' and '>' for #includes and prepends 36 | a '_' to the header guards. 37 | 38 | [--output DIR] 39 | Save generated files in the directory DIR. 40 | It's optional, but you should use it. CWD is used 41 | otherwise. 42 | 43 | IDLFILE 44 | The name of the file to process. It should end with 45 | .idl, although idlc shouldn't bork if it doesn't. 46 | Currently, it might bork. 47 | 48 | 49 | The following files are created in the output directory: 50 | 51 | If the idl file is XXX.idl 52 | 53 | If you're generating dependencies, the file is "IXXX.d" 54 | If you're generating-o-rama the files are "IXXX.h" and "IXXX.cpp" 55 | 56 | -------------------------------------------------------------------------------- /libraries/libbinder/package/PackageKit.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #if _SUPPORTS_NAMESPACE 19 | namespace palmos { 20 | namespace package { 21 | using namespace palmos::storage; 22 | using namespace palmos::support; 23 | #endif 24 | 25 | B_STATIC_STRING_VALUE_LARGE(key_file,"file",) 26 | 27 | sptr 28 | get_script_data_from_value(const SValue &info, status_t *error) 29 | { 30 | status_t err; 31 | SString filename; 32 | sptr file; 33 | 34 | filename = info[key_file].AsString(&err); 35 | if (err != B_OK) goto ERROR; 36 | 37 | file = new BFile(); 38 | err = file->SetTo(filename.String(), O_RDONLY); 39 | if (err != B_OK) { 40 | file = NULL; 41 | goto ERROR; 42 | } 43 | 44 | if (error) *error = B_OK; 45 | return new BByteStream(file); 46 | 47 | ERROR: 48 | // err now contains the error code, if there was an error, 49 | // data might be NULL. 50 | if (error) *error = err; 51 | return NULL; 52 | } 53 | 54 | #if _SUPPORTS_NAMESPACE 55 | } } 56 | #endif 57 | -------------------------------------------------------------------------------- /libraries/libbinder_component_glue/binder_component_glue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | // XXX we are including these all together as 19 | // a quick and dirty way to prevent set_package_image_object() 20 | // from being stripped by the linker. 21 | #include "binder_glue.cpp" 22 | 23 | using namespace palmos::support; 24 | 25 | // This must be exported from a shared library implementing a Binder package. 26 | // It is called by the package manager (in BProcess) to tell a newly 27 | // loading package shared library about the shared object associated with it. 28 | extern "C" void set_package_image_object(const sptr& image) 29 | { 30 | g_sharedObjectLock.Lock(); 31 | wptr oldPackage = g_sharedObject; // avoid deadlocks. 32 | g_sharedObject = image; 33 | if (g_pendingBufferRef) { 34 | //bout << "Transfering pending buffer ref!" << endl; 35 | image->IncStrong((const void*)&g_sharedBufferRefs); 36 | g_pendingBufferRef = 0; 37 | } 38 | g_sharedObjectLock.Unlock(); 39 | } 40 | -------------------------------------------------------------------------------- /tools/pidgen/idlc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef J_IDLC_H 14 | #define J_IDLC_H 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | // Temporary -- SMessage should not be a builtin type. 31 | enum { 32 | B_MESSAGE_TYPE = 100 33 | }; 34 | 35 | //#define SYMDEBUG 1 //debugs symbol & symbolstack 36 | //#define TYPEDEBUG 1 //debugs type engine - outpututil.cpp, typeparser.cpp, interfacerec.h&cpp 37 | //#define IDLDEBUG 1 // debug parser (yacc.y) 38 | //#define CPPDEBUG 1 // debug cpp output 39 | //#define STRUCTDEBUG 1 40 | 41 | // categories for IDLTypes - default is undefined, 42 | // S=standard types, B=B Prefixed types, U=user defined types 43 | 44 | int yyerror(char *errmsg); 45 | extern "C" int yyparse(void *voidref); 46 | 47 | 48 | 49 | #endif //J_IDLC_H 50 | -------------------------------------------------------------------------------- /tools/pidgen/SearchPath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include "SearchPath.h" 14 | 15 | //#include - it's not in storage2 now 16 | 17 | using namespace palmos::storage; 18 | 19 | SearchPath gSearchPath; 20 | 21 | void 22 | SearchPath::AddPath(const SString &path) 23 | { 24 | m_paths.AddItem(path); 25 | } 26 | 27 | /* 28 | status_t 29 | SearchPath::FindFullPath(const SString &file, SString &path) 30 | { 31 | if (file.Length() <= 0) return B_BAD_VALUE; 32 | 33 | // If absolute 34 | if (file.ByteAt(0) == '/') { 35 | path = file; 36 | return B_OK; 37 | } 38 | 39 | BEntry inCWD(file.String()); 40 | if (inCWD.Exists()) { 41 | SString yo; 42 | inCWD.GetPath(&yo); 43 | path = yo.String(); 44 | return B_OK; 45 | } 46 | uint32_t i, count = m_paths.CountItems(); 47 | for (i=0; i 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | namespace palmos { 21 | namespace xml { 22 | #endif // _SUPPORTS_NAMESPACE 23 | 24 | class BNamespaceMap : public SAtom 25 | { 26 | public: 27 | 28 | 29 | private: 30 | 31 | }; 32 | 33 | class BNamespaceCreator : public BCreator 34 | { 35 | public: 36 | 37 | BNamespaceCreator(); 38 | //BNamespaceCreator( 39 | 40 | virtual status_t OnStartTag( SString & name, 41 | SValue & attributes, 42 | sptr & newCreator ); 43 | 44 | virtual status_t OnStartTag( const SString & localName, 45 | const SString & nsID 46 | const SValue & attributes, 47 | sptr & newCreator ); 48 | 49 | virtual status_t OnEndTag( SString & name ); 50 | 51 | }; 52 | 53 | 54 | #if _SUPPORTS_NAMESPACE 55 | } } // namespace palmos::xml 56 | #endif // _SUPPORTS_NAMESPACE 57 | 58 | #endif // _XML2_NAMESPACE_CREATOR_H 59 | -------------------------------------------------------------------------------- /libraries/libbinder/xml/BufferSource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include // strlen() 14 | 15 | #include 16 | #include 17 | 18 | #if _SUPPORTS_NAMESPACE 19 | namespace palmos { 20 | namespace xml { 21 | #endif 22 | 23 | // ===================================================================== 24 | BXMLBufferSource::BXMLBufferSource(const char * buffer, int32_t len) 25 | :_data(buffer), 26 | _length(len) 27 | { 28 | if (_length < 0 && buffer) 29 | _length = strlen(buffer); 30 | else 31 | _length = len; 32 | // Nothing 33 | } 34 | 35 | 36 | // ===================================================================== 37 | BXMLBufferSource::~BXMLBufferSource() 38 | { 39 | // Nothing 40 | } 41 | 42 | 43 | // ===================================================================== 44 | status_t 45 | BXMLBufferSource::GetNextBuffer(size_t * size, uint8_t ** data, int * done) 46 | { 47 | if (!_data || _length < 0) 48 | return B_NO_INIT; 49 | *size = _length; 50 | *data = (uint8_t *) _data; 51 | *done = 1; 52 | return B_OK; 53 | } 54 | 55 | 56 | #if _SUPPORTS_NAMESPACE 57 | }; // namespace xml 58 | }; // namespace palmos 59 | #endif 60 | -------------------------------------------------------------------------------- /libraries/libbinder/xml/XMLOStr.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #if _SUPPORTS_NAMESPACE 17 | namespace palmos { 18 | namespace xml { 19 | #endif 20 | 21 | class BpXMLOStr : public BpInterface 22 | { 23 | public: 24 | 25 | BpXMLOStr(const sptr& o) 26 | : BpInterface(o) 27 | { 28 | } 29 | 30 | virtual status_t StartTag(SString &, SValue &) { ErrFatalError("Shoot me (geh)!"); return B_UNSUPPORTED; } 31 | virtual status_t EndTag(SString &) { ErrFatalError("Shoot me (geh)!"); return B_UNSUPPORTED; } 32 | virtual status_t Content(const char*, int32_t) { ErrFatalError("Shoot me (geh)!"); return B_UNSUPPORTED; } 33 | }; 34 | 35 | B_IMPLEMENT_META_INTERFACE(XMLOStr, "org.openbinder.xml.IXMLOStr", IXMLOStr) 36 | 37 | status_t 38 | IXMLOStr::Comment(const char *, int32_t) 39 | { 40 | return B_OK; 41 | } 42 | 43 | CXMLOStr::CXMLOStr() 44 | { 45 | } 46 | 47 | CXMLOStr::~CXMLOStr() 48 | { 49 | } 50 | 51 | status_t 52 | CXMLOStr::Told(SValue &) 53 | { 54 | return B_UNSUPPORTED; 55 | } 56 | 57 | #if _SUPPORTS_NAMESPACE 58 | }; // namespace xml 59 | }; // namespace palmos 60 | #endif 61 | -------------------------------------------------------------------------------- /headers/storage/BDatabaseStore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _STORAGE_BDATABASE_STORE_H 14 | #define _STORAGE_BDATABASE_STORE_H 15 | 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | #if _SUPPORTS_NAMESPACE 22 | namespace palmos { 23 | namespace storage { 24 | #endif 25 | 26 | class BDatabaseStore : public BMemoryStore 27 | { 28 | public: 29 | 30 | BDatabaseStore(DatabaseID db, int32_t restype, DmResourceID resid); 31 | BDatabaseStore(int32_t type, int32_t creator, int32_t restype, DmResourceID resid); 32 | 33 | status_t ErrorCheck() const; 34 | 35 | DatabaseID DbID() const; 36 | 37 | protected: 38 | virtual ~BDatabaseStore(); 39 | 40 | private: 41 | BDatabaseStore(const BDatabaseStore&); 42 | 43 | void init(); 44 | void open_resource(int32_t restype, DmResourceID resid); 45 | 46 | virtual void* MoreCore(void *oldBuf, size_t newsize); 47 | 48 | SDatabase m_db; 49 | MemHandle m_handle; 50 | MemPtr m_mem; 51 | size_t m_length; 52 | }; 53 | 54 | #if _SUPPORTS_NAMESPACE 55 | } } // namespace palmos::storage 56 | #endif 57 | 58 | #endif /* _STORAGE_BDATABASE_STORE_H */ 59 | -------------------------------------------------------------------------------- /headers/support/KeyID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_KEYID_H 14 | #define _SUPPORT_KEYID_H 15 | 16 | /*! @file support/KeyID.h 17 | @ingroup CoreSupportBinder 18 | @brief Class representing a KeyID, used to marshall and unmarshall KeyIDs 19 | across Binder interfaces and to send through IPC. 20 | */ 21 | 22 | // XXX This is old code from PalmOS, it should be removed. 23 | // (We would like the same kind of functionality with file descriptors, though...) 24 | 25 | #include 26 | 27 | typedef uint32_t KeyID; 28 | 29 | BNS(namespace palmos {) 30 | BNS(namespace support {) 31 | 32 | /*! @addtogroup CoreSupportBinder 33 | @{ 34 | */ 35 | 36 | //! Class representing a kernel KeyID. 37 | class SKeyID : virtual public SAtom { 38 | public: 39 | 40 | class FreeKey { 41 | public: 42 | FreeKey(); 43 | virtual ~FreeKey(); 44 | virtual status_t operator()(KeyID key) = 0; 45 | }; 46 | SKeyID(KeyID id, FreeKey* cleanup); 47 | KeyID AsKeyID(); 48 | protected: 49 | virtual ~SKeyID(); 50 | 51 | private: 52 | SKeyID(const SKeyID&); 53 | KeyID m_key; 54 | FreeKey *m_cleanup; 55 | }; 56 | 57 | /*! @} */ 58 | 59 | BNS(} }) 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /libraries/libbinder/xml/XMLIByteInputSource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #if _SUPPORTS_NAMESPACE 18 | namespace palmos { 19 | namespace xml { 20 | #endif 21 | 22 | // ===================================================================== 23 | BXMLIByteInputSource::BXMLIByteInputSource(const sptr& data) 24 | :_data(data) 25 | { 26 | // Nothing 27 | } 28 | 29 | 30 | // ===================================================================== 31 | BXMLIByteInputSource::~BXMLIByteInputSource() 32 | { 33 | // Nothing 34 | } 35 | 36 | 37 | // ===================================================================== 38 | status_t 39 | BXMLIByteInputSource::GetNextBuffer(size_t * size, uint8_t ** data, int * done) 40 | { 41 | if (_data == NULL) 42 | return B_NO_INIT; 43 | ssize_t bufSize = *size; 44 | bufSize = _data->Read(*data, bufSize); 45 | if (bufSize < 0) 46 | return bufSize; // Error 47 | *done = ((size_t) bufSize) < *size; 48 | *size = bufSize; 49 | return B_OK; 50 | } 51 | 52 | 53 | #if _SUPPORTS_NAMESPACE 54 | }; // namespace xml 55 | }; // namespace palmos 56 | #endif 57 | -------------------------------------------------------------------------------- /tools/pidgen/symbol.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include "symbolstack.h" 14 | 15 | IDLSymbol::IDLSymbol() 16 | { 17 | } 18 | 19 | IDLSymbol::IDLSymbol(const SString name) 20 | : m_id(name), m_type(NULL) 21 | { 22 | } 23 | 24 | IDLSymbol::IDLSymbol(const SString name, const sptr& aType) 25 | : m_id(name), m_type(aType) 26 | { 27 | } 28 | 29 | IDLSymbol::IDLSymbol(const IDLSymbol& aSymbol) 30 | : m_id(aSymbol.m_id), m_type(aSymbol.m_type) 31 | { 32 | } // copy constructor 33 | 34 | IDLSymbol::~IDLSymbol(void) 35 | { 36 | #ifdef SYMDEBUG 37 | //bout << "<----- symbol.cpp -----> ~IDLSymbol called - let's all go to hell!\n"; 38 | #endif SYMDEBUG 39 | // nothing is done here since m_type is handled by sptr reference counting 40 | } // destructor 41 | 42 | IDLSymbol & 43 | IDLSymbol::operator = (const IDLSymbol &symbol) 44 | { m_id=symbol.m_id; 45 | m_type=symbol.m_type; 46 | return *this; 47 | } // assignment operator 48 | 49 | 50 | status_t 51 | IDLSymbol::SetType(const sptr& aType) 52 | { m_type=aType; 53 | return B_OK; 54 | } 55 | 56 | sptr 57 | IDLSymbol::GetType() 58 | { return m_type; 59 | } 60 | 61 | SString 62 | IDLSymbol::GetId() 63 | { return m_id; 64 | } 65 | -------------------------------------------------------------------------------- /interfaces/support/Jamfile: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Copyright (c) 2002-2004 PalmSource, Inc. All rights reserved. 4 | # 5 | # File: Jamfile 6 | # 7 | # Release: Palm OS 6.1 8 | # 9 | ############################################################################### 10 | 11 | # Jamfile to build support interface files 12 | if ! $(PALMSOURCE_DEV_KIT) { 13 | PSSubDir TOP interfaces PDK support ; 14 | } else { 15 | PSSubDir TOP PDK interfaces support ; 16 | } 17 | 18 | # Build the idl-generated files 19 | #InterfaceIdl IByteStream.cpp : IByteStream.idl : libbinder ; 20 | InterfaceIdl IDatum.cpp : IDatum.idl : libbinder ; 21 | InterfaceIdl ICatalog.cpp : ICatalog.idl : libbinder ; 22 | InterfaceIdl INodeObserver.cpp : INodeObserver.idl : libbinder ; 23 | InterfaceIdl IIterable.cpp : IIterable.idl : libbinder ; 24 | InterfaceIdl IIterator.cpp : IIterator.idl : libbinder ; 25 | InterfaceIdl INib.cpp : INib.idl : libbinder ; 26 | InterfaceIdl IProcess.cpp : IProcess.idl : libbinder ; 27 | InterfaceIdl IProcessManager.cpp : IProcessManager.idl : libbinder ; 28 | InterfaceIdl IRandomIterator.cpp : IRandomIterator.idl : libbinder ; 29 | InterfaceIdl ISelector.cpp : ISelector.idl : libbinder ; 30 | InterfaceIdl IVirtualMachine.cpp : IVirtualMachine.idl : libbinder ; 31 | InterfaceIdl ICatalogPermissions.cpp : ICatalogPermissions.idl : libbinder ; 32 | InterfaceIdl INode.cpp : INode.idl : libbinder ; 33 | InterfaceIdl ITable.cpp : ITable.idl : libbinder ; 34 | InterfaceIdl IUuid.cpp : IUuid.idl : libbinder ; 35 | 36 | 37 | # Build the deliverables 38 | if ! $(PALMSOURCE_DEV_KIT) { 39 | PdkFile Jamfile [ Glob $(SUBDIR) : *.idl ] ; 40 | } 41 | -------------------------------------------------------------------------------- /headers/support/StringTokenizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_STRINGTOKENIZER_H 14 | #define _SUPPORT_STRINGTOKENIZER_H 15 | 16 | /*! @file support/StringTokenizer.h 17 | @ingroup CoreSupportUtilities 18 | @brief Helper for parsing strings. 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #if _SUPPORTS_NAMESPACE 25 | namespace palmos { 26 | namespace support { 27 | #endif 28 | 29 | /*! @addtogroup CoreSupportUtilities 30 | @{ 31 | */ 32 | 33 | class SStringTokenizer 34 | { 35 | public: 36 | SStringTokenizer(const SString& string, const SString& delimeters); 37 | SStringTokenizer(const SString& string, const char* delimeters = " \t\n\r\f"); 38 | SStringTokenizer(const char* string, const char* delimeters = " \t\n\r\f"); 39 | 40 | int32_t CountTokens(); 41 | bool HasMoreTokens(); 42 | SString NextToken(); 43 | SString NextToken(const SString& delimeters); 44 | 45 | private: 46 | void RegularExpressionize(); 47 | 48 | SRegExp m_regexp; 49 | SString m_string; 50 | SString m_delimeters; 51 | int32_t m_position; 52 | }; 53 | 54 | /*! @} */ 55 | 56 | #if _SUPPORTS_NAMESPACE 57 | } } // palmos::support 58 | #endif 59 | 60 | #endif // _SUPPORT_STRINGTOKENIZER_H 61 | -------------------------------------------------------------------------------- /components/tools/BinderShell/CV.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include "CV.h" 14 | 15 | B_STATIC_STRING_VALUE_8 (key_name, "name",) 16 | B_STATIC_STRING_VALUE_8 (key_Wait, "Wait",) 17 | B_STATIC_STRING_VALUE_8 (key_Open, "Open",) 18 | B_STATIC_STRING_VALUE_8 (key_Close, "Close",) 19 | B_STATIC_STRING_VALUE_12(key_Broadcast, "Broadcast",) 20 | 21 | ConditionVariable::ConditionVariable(const SValue &args) 22 | :BBinder(), 23 | SPackageSptr(), 24 | m_cv(args[key_name].AsString().String()), 25 | m_name(args[key_name].AsString()) 26 | { 27 | } 28 | 29 | ConditionVariable::~ConditionVariable() 30 | { 31 | } 32 | 33 | status_t 34 | ConditionVariable::Called(const SValue &func, const SValue &args, SValue *out) 35 | { 36 | if (func == key_Wait) { 37 | bout << "Waiting " << m_name << endl; 38 | m_cv.Wait(); 39 | } 40 | else if (func == key_Open) { 41 | bout << "Opening " << m_name << endl; 42 | m_cv.Open(); 43 | } 44 | else if (func == key_Close) { 45 | bout << "Closing " << m_name << endl; 46 | m_cv.Close(); 47 | } 48 | else if (func == key_Broadcast) { 49 | bout << "Broadcasting " << m_name << endl; 50 | m_cv.Broadcast(); 51 | } 52 | else { 53 | return B_BINDER_UNKNOWN_METHOD; 54 | } 55 | return B_OK; 56 | } 57 | 58 | 59 | -------------------------------------------------------------------------------- /headers/support/Memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_MEMORY_H_ 14 | #define _SUPPORT_MEMORY_H_ 15 | 16 | /*! @file support/Memory.h 17 | @ingroup CoreSupportBinder 18 | @brief Simple implementation of IMemoryHeap. 19 | */ 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #if _SUPPORTS_NAMESPACE 26 | namespace palmos { 27 | namespace support { 28 | #endif 29 | 30 | /*! @addtogroup CoreSupportBinder 31 | @{ 32 | */ 33 | 34 | #define MEMORYDEALER_NAME_TEMPLATE "/tmp/memoryarea.%s.%d" 35 | 36 | ////////////////////////////////////////////////////////////////// 37 | // BMemoryHeap 38 | ////////////////////////////////////////////////////////////////// 39 | 40 | //! A simple IMemoryHeap implementation. 41 | class BMemoryHeap : public BnMemoryHeap 42 | { 43 | public: 44 | BMemoryHeap(int32_t area, void* basePtr); 45 | virtual ~BMemoryHeap(); 46 | virtual int32_t HeapID() const; 47 | virtual void * HeapBase() const; 48 | private: 49 | int32_t m_area; 50 | void * m_basePtr; 51 | }; 52 | 53 | /*! @} */ 54 | 55 | #if _SUPPORTS_NAMESPACE 56 | } } // namespace palmos::support 57 | #endif 58 | 59 | #endif // _SUPPORT_MEMORY_H_ 60 | -------------------------------------------------------------------------------- /libraries/libbinder/xml/StringUtils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #if _SUPPORTS_NAMESPACE 19 | namespace palmos { 20 | namespace xml { 21 | #endif 22 | 23 | // Return the next string in str, starting after pos, in split. 24 | // split will start in the next character after any whitespace happening 25 | // at pos, and continue up until, but not including any whitespace. 26 | // ===================================================================== 27 | bool 28 | SplitStringOnWhitespace(const SString & str, SString & split, int32_t * pos) 29 | { 30 | if (*pos >= str.Length()) 31 | return false; 32 | 33 | int count = 0; 34 | const char * p = str.String() + *pos; 35 | 36 | // Use up any preceeding whitespace 37 | while (*p && isspace(*p)) 38 | p++; 39 | if (*p == '\0') 40 | return false; 41 | 42 | const char * s = p; 43 | 44 | // Go until the end 45 | while (*p && !isspace(*p)) 46 | { 47 | count++; 48 | p++; 49 | } 50 | 51 | split.SetTo(s, count); 52 | *pos = p - str.String(); 53 | return true; 54 | } 55 | 56 | 57 | 58 | #if _SUPPORTS_NAMESPACE 59 | }; // namespace xml 60 | }; // namespace palmos 61 | #endif 62 | -------------------------------------------------------------------------------- /docs/QuickStart.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @page QuickStart Quick Start 3 | 4 |
5 |
\< @ref License | @ref OpenBinder | @ref Building \>
6 |
7 |
8 | 9 | This page will guide you through select parts of the OpenBinder 10 | system and documentation to get started with it as quickly as possible, 11 | and leave out all that wordy wordy stuff. 12 | 13 | @section BuildingSec Building 14 | 15 | Following the directions on the @ref Building page to get a working 16 | build. Note that until you want to play with multiple processes, 17 | you can ignore the @ref MultiprocessBuild and following material. 18 | 19 | @section CPlusPlus C++ Coding 20 | 21 | For a quick look at what C++ coding with the Binder looks like, 22 | you can go to the @ref BinderRecipes. If you want to dig right 23 | in and start coding, you can make a copy of SampleComponent and 24 | begin by modifying that code. 25 | 26 | @verbatim 27 | cp -r samples/SampleComponent samples/MyComponent 28 | @endverbatim 29 | 30 | Be sure to change the Makefile to give your component its own 31 | package and shell command name. Once that is done, you should 32 | be able to run smooved: 33 | 34 | @verbatim 35 | make runshell 36 | @endverbatim 37 | 38 | And from with the Binder Shell then run your component: 39 | 40 | @verbatim 41 | /# my_component 42 | @endverbatim 43 | 44 | The other sample code can be used for a similar purpose. 45 | 46 | @section TheShell Binder Shell 47 | 48 | Another way to start playing with the Binder is to go through the 49 | @ref BinderShellTutorial. This will show you a lot of useful things 50 | you can do with the shell, while at the same time introducing you to 51 | many of the key Binder concepts. 52 | 53 | */ 54 | -------------------------------------------------------------------------------- /components/tools/BinderShell/CV.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | /* 14 | * This binder condition variable implements the following 15 | * methods: Wait, Open, Close and Broadcast, just like 16 | * SConditionVariable, except that there is no Wait that 17 | * takes a SLocker, and that it is implemented with a 18 | * scripting interface. So it will work across processes 19 | * but will do an IPC to lock and unlock, so don't do it, 20 | * because you will suck up lots of resources and waste a 21 | * lot of time. 22 | */ 23 | 24 | #ifndef CV_H 25 | #define CV_H 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #if _SUPPORTS_NAMESPACE 33 | using namespace palmos::support; 34 | #endif 35 | 36 | class ConditionVariable : public BBinder, public SPackageSptr 37 | { 38 | public: 39 | ConditionVariable(const SValue &args); 40 | virtual ~ConditionVariable(); 41 | 42 | virtual status_t Called( const SValue& func, 43 | const SValue& args, 44 | SValue* out); 45 | private: 46 | // no copy 47 | explicit ConditionVariable(const ConditionVariable &); 48 | 49 | SConditionVariable m_cv; 50 | const SString m_name; 51 | }; 52 | 53 | #endif // CV_H 54 | -------------------------------------------------------------------------------- /libraries/libbinder/Makefile: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(SRC_LIBRARIES)/libbinder/app/Makefile 4 | include $(SRC_LIBRARIES)/libbinder/arch/Makefile 5 | include $(SRC_LIBRARIES)/libbinder/package/Makefile 6 | include $(SRC_LIBRARIES)/libbinder/services/Makefile 7 | include $(SRC_LIBRARIES)/libbinder/storage/Makefile 8 | include $(SRC_LIBRARIES)/libbinder/support/Makefile 9 | include $(SRC_LIBRARIES)/libbinder/xml/Makefile 10 | 11 | include $(CLEAR_VARS) 12 | 13 | BASE_PATH:= $(LOCAL_PATH) 14 | TARGET_PATH:= $(OUT_LIBRARIES) 15 | NO_INTERFACE_DEPENDENCY:= 1 16 | DONT_BUILD_TARGET:= 1 17 | 18 | SRC_FILES:= \ 19 | $(appBootstrapSources) \ 20 | $(archBootstrapSources) \ 21 | $(packageBootstrapSources) \ 22 | $(servicesBootstrapSources) \ 23 | $(storageBootstrapSources) \ 24 | $(supportBootstrapSources) \ 25 | $(xmlBootstrapSources) 26 | TARGET:= libbinder_bootstrap 27 | 28 | # We normally want to do a release build for the 29 | # bootstrap library, since it is used as part of the build. 30 | LOCAL_CFLAGS+= -DLIBBE_BOOTSTRAP=1 $(TOOL_CFLAGS) 31 | LOCAL_LDFLAGS:= $(TOOL_LDFLAGS) 32 | 33 | include $(BUILD_HOST_STATIC_LIBRARY) 34 | 35 | include $(CLEAR_VARS) 36 | 37 | BASE_PATH:= $(LOCAL_PATH) 38 | TARGET_PATH:= $(OUT_LIBRARIES) 39 | 40 | SRC_FILES:= \ 41 | $(appSources) \ 42 | $(archSources) \ 43 | $(packageSources) \ 44 | $(servicesSources) \ 45 | $(storageSources) \ 46 | $(supportSources) \ 47 | $(xmlSources) 48 | IDL_FILES:= \ 49 | $(appIDLs) \ 50 | $(archIDLs) \ 51 | $(packageIDLs) \ 52 | $(servicesIDLs) \ 53 | $(storageIDLs) \ 54 | $(supportIDLs) \ 55 | $(xmlIDLs) 56 | LIB_FILES:= \ 57 | $(OUT_LIBRARIES)/libbinder_glue.a 58 | LOCAL_CFLAGS:= 59 | TARGET:= libbinder 60 | 61 | include $(BUILD_SHARED_LIBRARY) 62 | -------------------------------------------------------------------------------- /headers/support_p/WindowsStreams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT2_WINDOWSSTREAMS_H 14 | #define _SUPPORT2_WINDOWSSTREAMS_H 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #if _SUPPORTS_NAMESPACE 21 | namespace palmos { 22 | namespace support { 23 | #endif 24 | 25 | /*---------------------------------------------------------------------*/ 26 | 27 | class BWindowsOutputStream : public BnByteOutput 28 | { 29 | public: 30 | BWindowsOutputStream(); 31 | virtual ~BWindowsOutputStream(); 32 | 33 | virtual ssize_t WriteV(const struct iovec *vector, ssize_t count, uint32_t flags = 0); 34 | virtual status_t Sync(); 35 | 36 | private: 37 | }; 38 | 39 | /*-------------------------------------------------------------*/ 40 | 41 | class BWindowsInputStream : public BnByteInput 42 | { 43 | public: 44 | BWindowsInputStream(); 45 | virtual ~BWindowsInputStream(); 46 | 47 | virtual ssize_t ReadV(const struct iovec *vector, ssize_t count); 48 | 49 | private: 50 | }; 51 | 52 | /*-------------------------------------------------------------*/ 53 | 54 | #if _SUPPORTS_NAMESPACE 55 | } } // namespace palmos::support 56 | #endif 57 | 58 | #endif /* _SUPPORT2_WINDOWSSTREAMS_H */ 59 | -------------------------------------------------------------------------------- /samples/ServiceProcess/Service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include "Service.h" 14 | 15 | #include 16 | 17 | //! The constructor for the service does basic initialization. 18 | /*! Note that it passes its SContext up to the BCatalog class, so later 19 | we can retrieve it by calling Context() (a method implemented in BBinder). 20 | 21 | One thing to be careful of -- do NOT do anything here that may acquire 22 | a reference on this object, since at this point it has no references. 23 | That kind of initialization should be done in InitAtom(). In general 24 | all initialization that doesn't involve simple member variable 25 | initialization is done in InitAtom(). 26 | */ 27 | Service::Service(const SContext& context, const SValue &attr) 28 | : BCatalog(context) 29 | { 30 | } 31 | 32 | //! Destructor does nothing interesting. 33 | Service::~Service() 34 | { 35 | } 36 | 37 | //! InitAtom() is called immediately after the first reference is acquired on the object 38 | /*! This method is usually called when the object is first assigned to 39 | a sptr<>. At this point you can assume that no other threads can be 40 | accessing the object, since that would require they have their own 41 | references. 42 | */ 43 | void Service::InitAtom() 44 | { 45 | BCatalog::InitAtom(); 46 | } 47 | -------------------------------------------------------------------------------- /headers/support/StringIO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_STRINGIO_H 14 | #define _SUPPORT_STRINGIO_H 15 | 16 | /*! @file support/StringIO.h 17 | @ingroup CoreSupportDataModel 18 | @brief Binder IO stream for creating C strings. 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #if _SUPPORTS_NAMESPACE 26 | namespace palmos { 27 | namespace support { 28 | #endif 29 | 30 | /*! @addtogroup CoreSupportDataModel 31 | @{ 32 | */ 33 | 34 | /*-------------------------------------------------------------------*/ 35 | /*------- BStringIO Class -------------------------------------------*/ 36 | 37 | class BStringIO : public BMallocStore, public BTextOutput 38 | { 39 | public: 40 | 41 | BStringIO(); 42 | virtual ~BStringIO(); 43 | 44 | const char * String(); 45 | size_t StringLength() const; 46 | void Clear(off_t to); 47 | void Reset(); 48 | void PrintAndReset(const sptr& io); 49 | }; 50 | 51 | /*-------------------------------------------------------------*/ 52 | /*-------------------------------------------------------------*/ 53 | 54 | /*! @} */ 55 | 56 | #if _SUPPORTS_NAMESPACE 57 | } } // namespace palmos::support 58 | #endif 59 | 60 | #endif /* _SUPPORT_STRINGIO_H */ 61 | -------------------------------------------------------------------------------- /scripts/boot_script.bsh: -------------------------------------------------------------------------------- 1 | # This is an example Binder Shell boot script 2 | # for smooved, which starts up some standard 3 | # services. You can try running it from the build 4 | # system with "make runshell" 5 | 6 | # Before we do anything else create and set our user context 7 | # so that we can create objects in the user context 8 | # rather than in the system context. 9 | # (The system context is initialized by smooved at startup.) 10 | 11 | source $BSH_SCRIPT_DIR/user_context.bsh 12 | 13 | # The following command instantiates the Settings component 14 | # and publishes it under "/settings". This component 15 | # implements a hierarchical data structure that is backed by 16 | # a persistent XML file. 17 | 18 | new -p /settings org.openbinder.services.Settings 19 | 20 | # The following command instantiates the Informant component 21 | # and publishes it under "/services/informant". 22 | 23 | new -p /services/informant org.openbinder.services.base.Informant 24 | 25 | # The following command instantiates the TokenSource component 26 | # and publishes it under "/services/tokens". 27 | 28 | new -p /services/tokens org.openbinder.services.TokenSource 29 | 30 | # The following command instantiates the Memory Dealer component 31 | # and publishes it under "/services/memory_dealer". 32 | # 33 | # The Memory Dealer is a generic component that allocates 34 | # and managers a shared memory instance for each component 35 | # instance, implementing the IMemoryDealer interface 36 | # through which others can perform allocations in the 37 | # memory space. 38 | 39 | new -p /services/memory_dealer org.openbinder.services.MemoryDealer 40 | 41 | # This command creates a new empty process, and publishes 42 | # it under "/processes/background". 43 | 44 | new_process -p background 45 | 46 | echo "SmooveD is ready..." 47 | -------------------------------------------------------------------------------- /headers/support/SignalHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_SIGNAL_HANDLER_H 14 | #define _SUPPORT_SIGNAL_HANDLER_H 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #if _SUPPORTS_NAMESPACE 22 | namespace palmos { 23 | namespace support { 24 | #endif 25 | 26 | class SSignalHandler : public virtual SAtom 27 | { 28 | public: 29 | SSignalHandler(); 30 | 31 | virtual bool OnSignal(int32_t sig, const siginfo_t* si, const void* ucontext) = 0; 32 | 33 | status_t RegisterFor(int32_t sig); 34 | status_t UnregisterFor(int32_t sig); 35 | 36 | void Block(int32_t sig); 37 | void Unblock(int32_t sig); 38 | 39 | protected: 40 | virtual ~SSignalHandler(); 41 | }; 42 | 43 | class SChildSignalHandler : public SSignalHandler 44 | { 45 | public: 46 | SChildSignalHandler(); 47 | 48 | virtual bool OnSignal(int32_t sig, const siginfo_t* si, const void* ucontext); 49 | virtual bool OnChildSignal(int32_t sig, const siginfo_t* si, const void* ucontext, int pid, int status, const struct rusage * usage) = 0; 50 | 51 | void BlockChildHandling(); 52 | void UnblockChildHandling(); 53 | 54 | protected: 55 | virtual ~SChildSignalHandler(); 56 | }; 57 | 58 | #if _SUPPORTS_NAMESPACE 59 | } } // namespace palmos::support 60 | #endif 61 | 62 | #endif /* _SUPPORT_SIGNAL_HANDLER_H */ 63 | 64 | -------------------------------------------------------------------------------- /modules/binder/Makefile: -------------------------------------------------------------------------------- 1 | ifneq ($(KERNELRELEASE),) 2 | 3 | obj-m += binderdev.o 4 | 5 | binderdev-objs := iobuffer.o binder.o binder_node.o binder_proc.o binder_thread.o binder_transaction.o 6 | 7 | ifeq ($(strip $(CUSTOM_CFLAGS)),) 8 | CUSTOM_CFLAGS:= -I $(PWD)/../../headers 9 | endif 10 | CFLAGS += $(CUSTOM_CFLAGS) 11 | 12 | else 13 | 14 | KERNELDIR ?= /lib/modules/$(shell uname -r)/build 15 | PWD := $(shell pwd) 16 | 17 | modules default: 18 | $(MAKE) -C $(KERNELDIR) M=$(PWD) modules 19 | 20 | mi modules_install: 21 | $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install 22 | 23 | unloadmodules: 24 | @echo "Unloading Binder module..." 25 | @echo "You may need to enter your password" 26 | @sudo rmmod binderdev ; true 27 | @sleep 1 28 | @if [ "$$(lsmod | grep binderdev)" = "" ]; then \ 29 | echo "Binder module successfully unloaded."; \ 30 | fi 31 | 32 | loadmodules: modules 33 | @echo "Loading Binder module..." 34 | @echo "You may need to enter your password" 35 | @sudo rmmod binderdev ; true 36 | sudo insmod $(PWD)/binderdev.ko 37 | @sleep 1 38 | @if [ "$$(lsmod | grep binderdev)" = "" ]; then \ 39 | echo "Error loading binder module."; \ 40 | echo "Multiprocess will not be available."; \ 41 | else \ 42 | sudo chmod a+rw /dev/binder; \ 43 | echo "Binder module successfully installed."; \ 44 | fi 45 | 46 | 47 | $(KERNELDIR)/extra: 48 | mkdir $(KERNELDIR)/extra 49 | 50 | buggy_ubuntu: modules_install $(KERNELDIR)/extra 51 | mkdir -p /lib/modules/$(shell uname -r)/extra 52 | cp /lib/modules/$(shell uname -r | sed "s/-.*//")/extra/* /lib/modules/$(shell uname -r)/extra 53 | if [ -d /etc/udev/rules.d ] ; then \ 54 | echo "Installing binderdev.rules for udev" ; \ 55 | cp -f binderdev.rules /etc/udev/rules.d/ ; \ 56 | fi 57 | 58 | clean: 59 | $(MAKE) -C $(KERNELDIR) M=$(PWD) clean 60 | endif 61 | -------------------------------------------------------------------------------- /commands/bsh/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | int main(int argc, char* argv[]) 20 | { 21 | // This function retrieves the default (user) Binder context, 22 | // providing a back-door to accessing the Binder system when 23 | // not started as a component. 24 | SContext context(get_default_context()); 25 | if (context.InitCheck() != B_OK) { 26 | fprintf(stderr, "bsh: Unable to retrieve Binder context.\n"); 27 | fprintf(stderr, "bsh: The smooved server is probably not running.\n"); 28 | return context.InitCheck(); 29 | } 30 | 31 | // Instantiate the Binder Shell component. 32 | sptr shell = ICommand::AsInterface(context.New(SValue::String("org.openbinder.tools.BinderShell"))); 33 | if (shell == NULL) { 34 | fprintf(stderr, "bsh: Unable to instantiate Binder Shell component.\n"); 35 | return -ENOMEM; 36 | } 37 | 38 | // Connect the shell to this process's default io streams. 39 | shell->SetByteInput(StandardByteInput()); 40 | shell->SetByteOutput(StandardByteOutput()); 41 | shell->SetByteError(StandardByteOutput()); 42 | 43 | // Run the shell. 44 | ICommand::ArgList args; 45 | for (int i=0; iRun(args); 47 | return result.AsSSize(); 48 | } 49 | -------------------------------------------------------------------------------- /headers/xml/XMLParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _XML2_XMLPARSER_H 14 | #define _XML2_XMLPARSER_H 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | namespace palmos { 21 | namespace xml { 22 | using namespace support; 23 | #endif 24 | 25 | /**************************************************************************************/ 26 | 27 | class BXMLParser : public BXMLParseContext 28 | { 29 | public: 30 | 31 | BXMLParser(const sptr& stream); 32 | virtual ~BXMLParser(); 33 | 34 | virtual status_t OnDocumentBegin(uint32_t flags); 35 | virtual status_t OnDocumentEnd(); 36 | virtual status_t OnDocumentFail(); 37 | 38 | virtual status_t OnStartTag(SString &name, SValue &attributes); 39 | virtual status_t OnEndTag(SString &name); 40 | virtual status_t OnTextData(const char *data, int32_t size); 41 | virtual status_t OnCData(const char *data, int32_t size); 42 | 43 | virtual status_t OnGeneralParsedEntityRef(SString &name); 44 | virtual status_t OnGeneralParsedEntityRef(SString &name, SString &replacement); 45 | 46 | private: 47 | 48 | sptr m_stream; 49 | }; 50 | 51 | /**************************************************************************************/ 52 | 53 | #if _SUPPORTS_NAMESPACE 54 | } } // namespace palmos::xml 55 | #endif 56 | 57 | #endif // _B_XML2_PARSER_H 58 | -------------------------------------------------------------------------------- /headers/xml_p/validate_children.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef VALIDATE_CHILDREN_H 14 | #define VALIDATE_CHILDREN_H 15 | 16 | #include 17 | 18 | #if _SUPPORTS_NAMESPACE 19 | namespace palmos { 20 | namespace xml { 21 | #endif 22 | 23 | // Give this an elementDecl and it will give you a pointer to the transition 24 | // tables that it uses to do the validating. This data structure is opaque. 25 | // Don't forget to free it with _free_validate_table_ 26 | void _init_validate_table_(const BElementDecl * decl, const void ** tablePtr); 27 | 28 | // Give this a pointer to a uint16_t. It initializes it. Do this before you start. 29 | void _init_validate_state_(uint16_t * state); 30 | 31 | // Give it the state, the table and an element name. Will return B_OK if it's 32 | // allowed, and B_XML_CHILD_ELEMENT_NOT_ALLOWED if it's not. 33 | status_t _check_next_element_(const char * element, uint16_t * state, const void * table); 34 | 35 | // Give it the state and the table, and it will return B_OK if it's okay to 36 | // be done with children here, and B_XML_CHILD_PATTERN_NOT_FINISHED if it's not. 37 | status_t _check_end_of_element_(uint16_t state, const void * table); 38 | 39 | // Free the private table data 40 | void _free_validate_table_(const void * tableData); 41 | 42 | #if _SUPPORTS_NAMESPACE 43 | }; // namespace xml 44 | }; // namespace palmos 45 | #endif 46 | 47 | #endif // VALIDATE_CHILDREN_H 48 | -------------------------------------------------------------------------------- /modules/binder/iobuffer.h: -------------------------------------------------------------------------------- 1 | /* binder driver 2 | * Copyright (C) 2005 Palmsource, Inc. 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (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, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 17 | */ 18 | 19 | #ifndef _IOBUFFER_H_ 20 | #define _IOBUFFER_H_ 21 | 22 | #include 23 | 24 | typedef struct iobuffer { 25 | unsigned long m_base; 26 | int m_offs; 27 | int m_size; 28 | int m_consumed; 29 | } iobuffer_t; 30 | 31 | extern int iobuffer_init(iobuffer_t *that, unsigned long base, int size, int consumed); 32 | extern int iobuffer_read_raw(iobuffer_t *that, void *data, int size); 33 | extern int iobuffer_read_u32(iobuffer_t *that, u32 *data); 34 | extern int iobuffer_read_void(iobuffer_t *that, void **data); 35 | extern int iobuffer_write_raw(iobuffer_t *that, const void *data, int size); 36 | extern int iobuffer_write_u32(iobuffer_t *that, u32 data); 37 | extern int iobuffer_write_void(iobuffer_t *that, const void *data); 38 | extern int iobuffer_drain(iobuffer_t *that, int size); 39 | extern int iobuffer_remaining(iobuffer_t *that); 40 | extern int iobuffer_consumed(iobuffer_t *that); 41 | extern void iobuffer_mark_consumed(iobuffer_t *that); 42 | extern void iobuffer_remainder(iobuffer_t *that, void **ptr, int *size); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /components/services/Settings/Legacy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #include "Legacy.h" 17 | 18 | 19 | struct date_format 20 | { 21 | uint32_t key; 22 | const char* value; 23 | }; 24 | 25 | struct date_format g_dates[] = 26 | { 27 | { dfMDYWithSlashes, "%m/%d/%y" }, // 12/31/95 28 | { dfDMYWithSlashes, "%d/%m/%y" }, // 31/12/95 29 | { dfDMYWithDots, "%d.%m.%y" }, // 31.12.95 30 | { dfDMYWithDashes, "%d-%m-%y" }, // 31-12-95 31 | { dfYMDWithSlashes, "%y/%m/%d" }, // 95/12/31 32 | { dfYMDWithDots, "%y.%m.%d" }, // 95.12.31 33 | { dfYMDWithDashes, "%y.%m.%d" }, // 95-12-31 34 | { dfMDYLongWithComma, "" }, // Dec 31, 1995 35 | { dfDMYLong, "" }, // 31 Dec 1995 36 | { dfDMYLongWithDot, "" }, // 31. Dec 1995 37 | { dfDMYLongNoDay, "" }, // Dec 1995 38 | { dfDMYLongWithComma, "" }, // 31 Dec, 1995 39 | { dfYMDLongWithDot, "" }, // 1995.12.31 40 | { dfYMDLongWithSpace, "" }, // 1995 Dec 31 41 | { dfMYMed, "" }, // Dec '95 42 | { dfMYMedNoPost, "" }, // Dec 95 43 | { dfMDYWithDashes, "%m-%d-%y" }, // 12-31-95 44 | { 0, 0 } 45 | }; 46 | 47 | SValue legacy_date_format(const SValue& arg) 48 | { 49 | SValue result; 50 | 51 | uint32_t value = arg.AsInt32(); 52 | 53 | // double check to make sure that the struct lines up 54 | if (value == g_dates[value].key) 55 | { 56 | result = SValue::String(g_dates[value].value); 57 | } 58 | 59 | return result; 60 | } 61 | 62 | 63 | -------------------------------------------------------------------------------- /components/kits/support/SupportComponents.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #if _SUPPORTS_NAMESPACE 18 | using namespace palmos::support; 19 | #endif 20 | 21 | // helpful macro 22 | #define COMPONENT_CLASS_WITH_ARGS(Name, Base) \ 23 | class Name : public Base \ 24 | { \ 25 | public: \ 26 | Name(const SContext& context, const SValue &attr); \ 27 | private: \ 28 | SPackageSptr blah; \ 29 | }; \ 30 | Name::Name(const SContext& context, const SValue &attr) \ 31 | :Base(context, attr) \ 32 | { \ 33 | } 34 | 35 | #define COMPONENT_CLASS(Name, Base) \ 36 | class Name : public Base \ 37 | { \ 38 | public: \ 39 | Name(const SContext& context); \ 40 | private: \ 41 | SPackageSptr blah; \ 42 | }; \ 43 | Name::Name(const SContext& context) \ 44 | :Base(context) \ 45 | { \ 46 | } 47 | 48 | COMPONENT_CLASS_WITH_ARGS(CatalogMirrorComponent, BCatalogMirror); 49 | 50 | // ========================================================================= 51 | // Instantiation 52 | // ========================================================================= 53 | 54 | sptr InstantiateComponent( const SString& component, 55 | const SContext& context, 56 | const SValue &args) 57 | { 58 | if (component == "CatalogMirror") { 59 | return static_cast(new CatalogMirrorComponent(context, args)); 60 | } 61 | 62 | return NULL; 63 | } 64 | -------------------------------------------------------------------------------- /headers/package_p/ManifestParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _PACKAGE_MANIFESTPARSER_H 14 | #define _PACKAGE_MANIFESTPARSER_H 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | 21 | #if _SUPPORTS_NAMESPACE 22 | namespace palmos { 23 | namespace package { 24 | #endif 25 | 26 | 27 | class SManifestParser : public SLightAtom 28 | { 29 | public: 30 | //! Parses an IByteInput and calls the callbacks on a parser 31 | static status_t ParseManifest(const SString& filename, const sptr& parser, const sptr& stream, const SPackage& resources, const SString& package); 32 | 33 | //! Parses an IByteInput that is at the beginning of a package file, looking for an 34 | // embedded manifest file, and calls the callbacks on a parser 35 | static status_t ParseManifestFromPackageFile(const SString& filename, const sptr& parser, const sptr& stream, const SPackage& resources, const SString& package); 36 | 37 | //! Callback: A protein plugin was declared 38 | virtual void OnDeclareAddon(const SValue& addonInfo) = 0; 39 | 40 | //! Callback: An application was declared 41 | virtual void OnDeclareApplication(const SValue& appInfo) = 0; 42 | 43 | //! Callback: A new component was declared 44 | virtual void OnDeclareComponent(const SValue& componentInfo) = 0; 45 | }; 46 | 47 | 48 | #if _SUPPORTS_NAMESPACE 49 | } } // namespace palmos::package 50 | #endif 51 | 52 | #endif // _PACKAGE_MANIFESTPARSER_H 53 | -------------------------------------------------------------------------------- /interfaces/support/ICatalogPermissions.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | /*! @file support/ICatalogPermissions.idl 14 | @ingroup CoreSupportDataModel 15 | 16 | @brief Modification to ICatalog without touching the original catalog. 17 | */ 18 | 19 | import 20 | 21 | namespace palmos { 22 | namespace support { 23 | 24 | //! ICatalogPermissions provides for ICatalog modifications. 25 | /*! But without modifying the original catalog. 26 | It might seem that ICatalogPermissions should be called 27 | something different and should inherit from ICatalog. 28 | However, we need to separate the interfaces for 29 | security purposes. (If you have an ICatalog, that is 30 | all you can see, but if you have an ICatalogPermissions 31 | then you can work with both interfaces.) 32 | 33 | @ingroup CoreSupportDataModel 34 | */ 35 | interface ICatalogPermissions 36 | { 37 | properties: 38 | bool writable; 39 | 40 | methods: 41 | //! Hide an entry from the original catalog 42 | status_t HideEntry(SString name); 43 | 44 | //! Show an entry that was previously hidden 45 | status_t ShowEntry(SString name); 46 | 47 | //! Overlay an entry in the original catalog 48 | /*! Overlay an entry in the original catalog 49 | * with the replacement. 50 | */ 51 | status_t OverlayEntry(SString location, SValue item); 52 | 53 | //! Restore an entry that was previously replaced 54 | status_t RestoreEntry(SString location); 55 | 56 | status_t Merge(ICatalog catalog); 57 | } 58 | 59 | } } // namespace palmos::support 60 | -------------------------------------------------------------------------------- /samples/SampleComponent/SampleComponent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include "SampleComponent.h" 14 | 15 | #include 16 | 17 | // These macros are optimizations for creating static SValue and 18 | // SString objects that reside in your executable's bss section 19 | // and don't need to have their constructor/destructor called. 20 | B_STATIC_STRING_VALUE_LARGE(k_world, "world", ); 21 | B_STATIC_STRING_VALUE_LARGE(k_hello, "hello", ); 22 | B_STATIC_STRING_VALUE_LARGE(k_documentation, "documentation", ); 23 | 24 | SampleComponent::SampleComponent(const SContext& context, const SValue & /*attr*/) 25 | : BCommand(context) 26 | { 27 | } 28 | 29 | SampleComponent::~SampleComponent() 30 | { 31 | } 32 | 33 | SValue SampleComponent::Run(const ArgList& args) 34 | { 35 | const size_t N = args.CountItems(); 36 | 37 | // Retrieve first argument -- command name 38 | SValue me(0 < N ? args[0] : B_UNDEFINED_VALUE); 39 | 40 | // Retrieve second argument -- someone else 41 | SString you(1 < N ? args[1].AsString() : SString()); 42 | 43 | // If second argument wasn't supplied, give a default value 44 | if (you == "") you = LoadString(k_world); 45 | 46 | // Print a message! Yes, the localization is dorky, but 47 | // it's just to demonstrate the APIs. 48 | TextOutput() << me.AsString() << " " << LoadString(k_hello) << " " << you << "!" << endl; 49 | 50 | // Return success 51 | return SValue::Status(B_OK); 52 | } 53 | 54 | SString SampleComponent::Documentation() const 55 | { 56 | return LoadString(k_documentation); 57 | } 58 | -------------------------------------------------------------------------------- /headers/ErrorMgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | /*! 14 | @file ErrorMgr.h 15 | 16 | @brief Error checking and reporting macros, whose behavior depends on BUILD_TYPE. 17 | */ 18 | 19 | #ifndef _ERRORMGR_H_ 20 | #define _ERRORMGR_H_ 21 | 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | //--------------------------------------------------------------------------------------- 29 | // You probably don't want to use this function unless you want show a different 30 | // file name and line number. 31 | void ErrFatalErrorInContext(const char* fileName, uint32_t lineNum, const char* msg); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | //--------------------------------------------------------------------------------------- 38 | // ErrFatalError and ErrFatalErrorIf will always compiled in. 39 | #define ErrFatalError(msg) ErrFatalErrorInContext(MODULE_NAME, __LINE__, msg) 40 | #define ErrFatalErrorIf(condition, msg) ((condition) ? ErrFatalError(msg) : (void)0) 41 | 42 | //--------------------------------------------------------------------------------------- 43 | // DbgOnlyFatalError and DbgOnlyFatalErrorIf will only be compiled in on Debug builds. 44 | #if BUILD_TYPE != BUILD_TYPE_RELEASE 45 | # define DbgOnlyFatalError(msg) ErrFatalError(msg) 46 | # define DbgOnlyFatalErrorIf(condition, msg) ErrFatalErrorIf(condition, msg) 47 | #else 48 | # define DbgOnlyFatalError(msg) /* NOP */ 49 | # define DbgOnlyFatalErrorIf(condition, msg) /* NOP */ 50 | #endif 51 | 52 | #endif // _ERRORMGR_H_ 53 | -------------------------------------------------------------------------------- /headers/support/InstantiateComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _B_SUPPORT_INSTANTIATECOMPONENT 14 | #define _B_SUPPORT_INSTANTIATECOMPONENT 15 | 16 | /*! @file support/InstantiateComponent.h 17 | @ingroup CoreSupportBinder 18 | @brief API to package executables that contain components. 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | /*! @addtogroup CoreSupportBinder 26 | @{ 27 | */ 28 | 29 | #if TARGET_HOST == TARGET_HOST_PALMOS 30 | #include 31 | #else 32 | #define sysPackageLaunchGetInstantiate 72 33 | #endif 34 | 35 | #if _SUPPORTS_NAMESPACE 36 | namespace palmos { 37 | namespace support { 38 | #endif 39 | 40 | typedef sptr (*instantiate_component_func)(const SString& component, 41 | const SContext& context, 42 | const SValue &args); 43 | 44 | struct SysPackageLaunchGetInstantiateType 45 | { 46 | size_t size; 47 | instantiate_component_func out_instantiate; 48 | }; 49 | 50 | #if _SUPPORTS_NAMESPACE 51 | } } // namespace palmos::support 52 | #endif 53 | 54 | //! This is a prototype for the factory function you should implement to create components. 55 | extern "C" 56 | BNS(palmos::support::) sptr 57 | InstantiateComponent( const BNS(palmos::support::) SString& component, 58 | const BNS(palmos::support::) SContext& context, 59 | const BNS(palmos::support::) SValue& args); 60 | 61 | 62 | /*! @} */ 63 | 64 | #endif // _B_SUPPORT_INSTANTIATECOMPONENT 65 | -------------------------------------------------------------------------------- /libraries/libbinder/support/Flattenable.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #if _SUPPORTS_NAMESPACE 18 | namespace palmos { 19 | namespace support { 20 | #endif 21 | 22 | ssize_t 23 | SFlattenable::ParcelSize(int32_t form) const 24 | { 25 | SParcel temp; 26 | SValue value(AsValue(form)); 27 | value.Archive(temp); 28 | return temp.Length(); 29 | } 30 | 31 | ssize_t 32 | SFlattenable::WriteParcel(SParcel& target, int32_t form) const 33 | { 34 | return AsValue(form).Archive(target); 35 | } 36 | 37 | ssize_t 38 | SFlattenable::ReadParcel(type_code type, SParcel& source, ssize_t) 39 | { 40 | if (type != TypeCode()) return B_BAD_TYPE; 41 | 42 | SValue value = source.ReadValue(); 43 | status_t result = SetFromValue(value); 44 | return result; 45 | } 46 | 47 | // ------------- 48 | 49 | ssize_t 50 | SFlattenable::FlattenedSize() const 51 | { 52 | return ParcelSize(B_FLATTEN_FORM_ACTIVE); 53 | } 54 | 55 | status_t 56 | SFlattenable::Flatten(void *buffer, ssize_t size) const 57 | { 58 | SParcel target(buffer, size); 59 | return WriteParcel(target, B_FLATTEN_FORM_ACTIVE); 60 | } 61 | 62 | status_t 63 | SFlattenable::Unflatten(type_code c, const void *buf, ssize_t size) 64 | { 65 | SParcel source(buf, size); 66 | return ReadParcel(c, source, size); 67 | } 68 | 69 | bool SFlattenable::AllowsTypeCode(type_code c) const 70 | { 71 | return (c == TypeCode()); 72 | } 73 | 74 | #if _SUPPORTS_NAMESPACE 75 | } } // namespace palmos::support 76 | #endif 77 | -------------------------------------------------------------------------------- /headers/xml/XML2ValueParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _VALUE_PARSER_H 14 | #define _VALUE_PARSER_H 15 | 16 | #include 17 | #include 18 | 19 | #if _SUPPORTS_NAMESPACE 20 | namespace palmos { 21 | namespace xml { 22 | #endif 23 | 24 | // ================================================================== 25 | class BXML2ValueCreator : public BCreator 26 | { 27 | public: 28 | BXML2ValueCreator(SValue &targetValue, const SValue &attributes, const SPackage& resources = B_NO_PACKAGE, const SValue &references = B_UNDEFINED_VALUE); 29 | 30 | virtual status_t OnStartTag( SString & name, 31 | SValue & attributes, 32 | sptr & newCreator ); 33 | 34 | virtual status_t OnEndTag( SString & name ); 35 | 36 | virtual status_t OnText( SString & data ); 37 | 38 | virtual status_t Done(); 39 | 40 | private: 41 | static status_t ParseSignedInteger (const BNS(palmos::support::) SString &from, int64_t maximum, int64_t *val); 42 | SPackage m_resources; 43 | BNS(palmos::support::) SValue &m_targetValue; 44 | BNS(palmos::support::) SValue m_key; 45 | BNS(palmos::support::) SValue m_value; 46 | BNS(palmos::support::) SString m_data; 47 | BNS(palmos::support::) SString m_dataType; 48 | status_t m_status; 49 | SValue m_references; 50 | type_code m_rawTypeCode; 51 | size_t m_rawSize; 52 | int32_t m_resID; 53 | int32_t m_strIndex; 54 | bool m_isReference : 1; 55 | 56 | int32_t m_id; 57 | }; 58 | 59 | #if _SUPPORTS_NAMESPACE 60 | } } // palmos::xml 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /tools/pidgen/pidgenfiles/IFeatures.idl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | namespace palmos { 14 | namespace support { 15 | 16 | // Note that the idl compiler currently doesn't support output parameters, 17 | // so we need to tweak the API a bit by returning BValue objects where we 18 | // need multiple results. This will change once the idl compiler improves. 19 | 20 | // Supply C++-language specific information for this interface. 21 | interface IFeatures 22 | { 23 | methods: 24 | status_t SetFeature(uint32 creator, uint32 featureNum, uint32 value); 25 | BValue GetFeature(uint32 creator, uint32 featureNum); 26 | // Will be: status_t GetFeature(uint32 creator, uint32 featureNum, [out] uint32 out_value); 27 | status_t UnregisterFeature(uint32 creator, uint32 featureNum); 28 | 29 | // Return value contains mappings: "creator", "number", "value" 30 | BValue GetFeatureAt(uint32 index, bool romTable); 31 | // Will be: status_t GetFeatureAt(uint32 index, bool romTable, [out] uint32 out_creator, 32 | // [out] uint32 out_featureNum, [out] uint32 out_value); 33 | 34 | BValue NewPointer(uint32 creator, uint32 featureNum, size_t size); 35 | // Will be: status_t NewPointer(uint32 creator, uint32 featureNum, 36 | // size_t size, [out] void* out_ptr); 37 | status_t FreePointer(uint32 creator, uint32 featureNum); 38 | BValue ResizePointer(uint32 creator, uint32 featureNum, size_t size); 39 | // Will be: status_t ResizePointer(uint32 creator, uint32 featureNum, 40 | // size_t size, [out] void* out_ptr); 41 | } 42 | 43 | } } // namespace palmos::support 44 | -------------------------------------------------------------------------------- /headers/support/KernelStreams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_KERNELSTREAMS_H 14 | #define _SUPPORT_KERNELSTREAMS_H 15 | 16 | /*! @file support/KernelStreams.h 17 | @ingroup CoreSupportDataModel 18 | @brief Byte stream to a file descriptor (not supported on Palm OS). 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #if _SUPPORTS_NAMESPACE 26 | namespace palmos { 27 | namespace support { 28 | #endif 29 | 30 | /*! @addtogroup CoreSupportDataModel 31 | @{ 32 | */ 33 | 34 | /*---------------------------------------------------------------------*/ 35 | 36 | class BKernelOStr : public BnByteOutput 37 | { 38 | public: 39 | BKernelOStr(int32_t descriptor); 40 | virtual ~BKernelOStr(); 41 | 42 | virtual ssize_t WriteV(const struct iovec *vector, ssize_t count, uint32_t flags = 0); 43 | virtual status_t Sync(); 44 | 45 | private: 46 | 47 | int32_t m_descriptor; 48 | }; 49 | 50 | /*-------------------------------------------------------------*/ 51 | 52 | class BKernelIStr : public BnByteInput 53 | { 54 | public: 55 | BKernelIStr(int32_t descriptor); 56 | virtual ~BKernelIStr(); 57 | 58 | virtual ssize_t ReadV(const struct iovec *vector, ssize_t count, uint32_t flags = 0); 59 | 60 | private: 61 | 62 | int32_t m_descriptor; 63 | }; 64 | 65 | /*-------------------------------------------------------------*/ 66 | 67 | /*! @} */ 68 | 69 | #if _SUPPORTS_NAMESPACE 70 | } } // namespace palmos::support 71 | #endif 72 | 73 | #endif /* _SUPPORT_KERNELSTREAMS_H */ 74 | -------------------------------------------------------------------------------- /headers/support/Selector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Palmsource, Inc. 3 | * 4 | * This software is licensed as described in the file LICENSE, which 5 | * you should have received as part of this distribution. The terms 6 | * are also available at http://www.openbinder.org/license.html. 7 | * 8 | * This software consists of voluntary contributions made by many 9 | * individuals. For the exact contribution history, see the revision 10 | * history and logs, available at http://www.openbinder.org 11 | */ 12 | 13 | #ifndef _SUPPORT_SELECTOR_H 14 | #define _SUPPORT_SELECTOR_H 15 | 16 | /*! @file support/Selector.h 17 | @ingroup CoreSupportBinder 18 | @brief Select something with the Binder! 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | /* @addtogroup CoreSupportBinder 26 | @{ 27 | */ 28 | 29 | //! When you set the value, it pushes \@{"value"->\<the new value\>} 30 | #if _SUPPORTS_NAMESPACE 31 | namespace palmos { 32 | namespace support { 33 | #endif 34 | 35 | class BSelector : public BnSelector 36 | { 37 | public: 38 | BSelector(); 39 | BSelector(const SContext& context); 40 | BSelector(const SContext& context, const SValue &initialValue); 41 | virtual ~BSelector(); 42 | 43 | virtual SValue Value() const; 44 | virtual void SetValue(const SValue &value); 45 | 46 | virtual status_t Register(const SValue &key, const sptr &binder, 47 | const SValue &property, uint32_t flags = 0); 48 | virtual status_t Unregister(const SValue &key, const sptr &binder, 49 | const SValue &property, uint32_t flags = 0); 50 | 51 | private: 52 | struct Registration { 53 | sptr binder; 54 | SValue property; 55 | uint32_t flags; 56 | }; 57 | 58 | static void send_to_binders(const SVector ®s, bool value); 59 | 60 | mutable SLocker m_lock; 61 | SValue m_value; 62 | SKeyedVector > m_regs; 63 | }; 64 | 65 | /*! @} */ 66 | #if _SUPPORTS_NAMESPACE 67 | } } // palmos::support; 68 | #endif 69 | 70 | #endif // _SUPPORT_SELECTOR_H 71 | --------------------------------------------------------------------------------