bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 TeamWin - bigbiff and Dees_Troy mtp database conversion to C++ |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef TWRPMTP_HPP |
| 18 | #define TWRPMTP_HPP |
| 19 | |
| 20 | #include <fcntl.h> |
| 21 | #include <utils/Errors.h> |
| 22 | #include <utils/threads.h> |
| 23 | #include <string> |
| 24 | #include <vector> |
| 25 | #include <pthread.h> |
| 26 | #include "MtpTypes.h" |
| 27 | #include "MtpPacket.h" |
| 28 | #include "MtpDataPacket.h" |
| 29 | #include "MtpDatabase.h" |
| 30 | #include "MtpRequestPacket.h" |
| 31 | #include "MtpResponsePacket.h" |
| 32 | #include "mtp_MtpDatabase.hpp" |
| 33 | |
| 34 | class twrpMtp { |
| 35 | public: |
Ethan Yonker | 6d154c4 | 2014-09-03 14:19:43 -0500 | [diff] [blame] | 36 | twrpMtp(int debug_enabled /* = 0 */); |
Ethan Yonker | 8dfa777 | 2014-09-04 21:48:41 -0500 | [diff] [blame] | 37 | pthread_t threadserver(void); |
| 38 | pid_t forkserver(void); |
bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 39 | void addStorage(std::string display, std::string path, int mtpid); |
| 40 | private: |
| 41 | int start(void); |
| 42 | typedef int (twrpMtp::*ThreadPtr)(void); |
| 43 | typedef void* (*PThreadPtr)(void *); |
| 44 | storages *mtpstorages; |
| 45 | storage *s; |
| 46 | }; |
| 47 | #endif |