| OLD | NEW |
| 1 /* Copyright 2014 The Native Client Authors. All rights reserved. | 1 /* Copyright 2014 The Native Client Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. */ | 3 * found in the LICENSE file. */ |
| 4 | 4 |
| 5 #include "operations.h" | 5 #include "operations.h" |
| 6 | 6 |
| 7 #include <alloca.h> | 7 #include <alloca.h> |
| 8 #include <assert.h> | 8 #include <assert.h> |
| 9 #include <errno.h> | 9 #include <errno.h> |
| 10 #include <git2.h> | 10 #include <git2.h> |
| 11 #include <git2/transport.h> | 11 #include <git2/transport.h> |
| 12 #include <nacl_main.h> | |
| 13 #include <string.h> | 12 #include <string.h> |
| 14 #include <stdio.h> | 13 #include <stdio.h> |
| 15 #include <stdlib.h> | 14 #include <stdlib.h> |
| 16 #include <sys/mount.h> | 15 #include <sys/mount.h> |
| 17 #include <sys/stat.h> | 16 #include <sys/stat.h> |
| 18 #include <ppapi/c/pp_errors.h> | 17 #include <ppapi/c/pp_errors.h> |
| 19 #include <ppapi/c/pp_var.h> | 18 #include <ppapi/c/pp_var.h> |
| 20 #include <ppapi/c/ppb_messaging.h> | 19 #include <ppapi/c/ppb_messaging.h> |
| 21 #include <ppapi/c/ppb_var_array.h> | 20 #include <ppapi/c/ppb_var_array.h> |
| 22 #include <ppapi/c/ppb_var.h> | 21 #include <ppapi/c/ppb_var.h> |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 122 } |
| 124 | 123 |
| 125 handle_cmd(cmd, repo_directory, arg); | 124 handle_cmd(cmd, repo_directory, arg); |
| 126 } | 125 } |
| 127 | 126 |
| 128 git_smart_subtransport_definition pepper_http_subtransport_definition = { | 127 git_smart_subtransport_definition pepper_http_subtransport_definition = { |
| 129 git_smart_subtransport_pepper_http, | 128 git_smart_subtransport_pepper_http, |
| 130 1 /* use rpc */ | 129 1 /* use rpc */ |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 int nacl_main(int argc, char** argv) { | 132 int main(int argc, char** argv) { |
| 134 srand(123); | 133 srand(123); |
| 135 int rtn = git_threads_init(); | 134 int rtn = git_threads_init(); |
| 136 if (rtn) { | 135 if (rtn) { |
| 137 output("git_threads_init failed: %d\n", rtn); | 136 output("git_threads_init failed: %d\n", rtn); |
| 138 return 1; | 137 return 1; |
| 139 } | 138 } |
| 140 | 139 |
| 141 rtn = git_smart_subtransport_pepper_http_init(PSGetInstanceId(), | 140 rtn = git_smart_subtransport_pepper_http_init(PSGetInstanceId(), |
| 142 PSGetInterface); | 141 PSGetInterface); |
| 143 if (rtn) { | 142 if (rtn) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 163 PSEventSetFilter(PSE_INSTANCE_HANDLEMESSAGE); | 162 PSEventSetFilter(PSE_INSTANCE_HANDLEMESSAGE); |
| 164 while (1) { | 163 while (1) { |
| 165 PSEvent* event = PSEventWaitAcquire(); | 164 PSEvent* event = PSEventWaitAcquire(); |
| 166 if (event->type != PSE_INSTANCE_HANDLEMESSAGE) | 165 if (event->type != PSE_INSTANCE_HANDLEMESSAGE) |
| 167 output("unexpected message type: %d\n", event->type); | 166 output("unexpected message type: %d\n", event->type); |
| 168 handle_message(event->as_var); | 167 handle_message(event->as_var); |
| 169 PSEventRelease(event); | 168 PSEventRelease(event); |
| 170 } | 169 } |
| 171 return 0; | 170 return 0; |
| 172 } | 171 } |
| OLD | NEW |