summary refs log tree commit diff stats
path: root/tests/stdlib/thttpclient_standalone.nim
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-02-24 03:22:47 -0600
committerGitHub <noreply@github.com>2021-02-24 10:22:47 +0100
commit3f38f8fbb7c0dd3af641961ed98ef0e67ea91f3c (patch)
treef0ad53e014bcfb3bc321287c341198c9d349c9a5 /tests/stdlib/thttpclient_standalone.nim
parent46bd222c89c57217d1d4738f84f52de94f092c1d (diff)
downloadNim-3f38f8fbb7c0dd3af641961ed98ef0e67ea91f3c.tar.gz
add strbasics.strip (#16280)
Diffstat (limited to 'tests/stdlib/thttpclient_standalone.nim')
0 files changed, 0 insertions, 0 deletions
='n122' href='#n122'>122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
 +0200

--os:standalone works again' href='/ahoang/Nim/commit/lib/system/ansi_c.nim?h=devel&id=52851b722d072f1306d699cc245af033cf76519a'>52851b722 ^
4d01408a4 ^
43bddf62d ^
52851b722 ^


405b86068
8ec5c01ca ^
9589acd00 ^
405b86068
bd88e526c ^

796d939c6 ^


405b86068
064417fc5 ^
dd806cafa ^
32ef1f8f3 ^


92b8fac94 ^




32ef1f8f3 ^
4d01408a4 ^
feb9af48f ^






9428bedcc ^
32ef1f8f3 ^








9428bedcc ^

405b86068

feb9af48f ^



405b86068
32ef1f8f3 ^
405b86068
f99c40f61 ^
















405b86068
38dee2095 ^
405b86068
38dee2095 ^
405b86068
796d939c6 ^
52851b722 ^
796d939c6 ^
52851b722 ^
796d939c6 ^
52851b722 ^
796d939c6 ^
52851b722 ^
796d939c6 ^
52851b722 ^
796d939c6 ^
52851b722 ^
4d01408a4 ^
52851b722 ^
405b86068
796d939c6 ^
52851b722 ^
796d939c6 ^
405b86068
43bddf62d ^
52851b722 ^
405b86068

796d939c6 ^
52851b722 ^
796d939c6 ^
52851b722 ^
405b86068
796d939c6 ^
52851b722 ^
405b86068
52851b722 ^
796d939c6 ^
52851b722 ^
796d939c6 ^
52851b722 ^
796d939c6 ^
52851b722 ^
db4f617af ^
52851b722 ^



4d4b3b1c0 ^
30f856857 ^
dd806cafa ^
32ef1f8f3 ^

43bddf62d ^
32ef1f8f3 ^



4d4b3b1c0 ^

32ef1f8f3 ^
52851b722 ^
32ef1f8f3 ^
52851b722 ^
4d4b3b1c0 ^
32ef1f8f3 ^


4d4b3b1c0 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161

 
                                  
                                         





                                                    
                                               

                                                         

                 
                                                          
                                   
                                                                     
                                   
                                                                                   
                                                      


                                                    
 
    
                                                                
 

                     


                                                
 
                               
                          


                          




                          
                          
                                           






                          
                          








                                                      

                                                      

                     



                                                  
     
                                 
 
















                                                             
 
                                                                
                                           
                                                                   
 
                                                     
                       
                                                      
                                         
                                                   
                       
                                                   
                       
                                                     
                       
                                         
                                                    
                               
                                                   
 
                                              
                                         
                                                                 
 
                                                               
                                             

                                                               
                                                         
                                         
                                                         
                                         
 
                                                          
                                          
 
                                                                      
                                    
                                          
                                                                      
                                                         
                                  
                                        
 



                                                                             
 
                            
                           

                                              
                            



                                                                        

                                                                      
                                         
                                          
                                                 
                                          
 


                                                                                

      
#
#
#            Nim's Runtime Library
#        (c) Copyright 2013 Andreas Rumpf
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

# This include file contains headers of Ansi C procs
# and definitions of Ansi C types in Nim syntax
# All symbols are prefixed with 'c_' to avoid ambiguities

{.push hints:off}

proc c_strcmp(a, b: cstring): cint {.header: "<string.h>",
  noSideEffect, importc: "strcmp".}
proc c_memcmp(a, b: cstring, size: int): cint {.header: "<string.h>",
  noSideEffect, importc: "memcmp".}
proc c_memcpy(a, b: cstring, size: int) {.header: "<string.h>", importc: "memcpy".}
proc c_strlen(a: cstring): int {.header: "<string.h>",
  noSideEffect, importc: "strlen".}
proc c_memset(p: pointer, value: cint, size: int) {.
  header: "<string.h>", importc: "memset".}

type
  C_JmpBuf {.importc: "jmp_buf", header: "<setjmp.h>".} = object

when not defined(vm):
  var
    c_stdin {.importc: "stdin", nodecl.}: File
    c_stdout {.importc: "stdout", nodecl.}: File
    c_stderr {.importc: "stderr", nodecl.}: File

# constants faked as variables:
when not declared(SIGINT):
  when NoFakeVars:
    when defined(windows):
      const
        SIGABRT = cint(22)
        SIGFPE = cint(8)
        SIGILL = cint(4)
        SIGINT = cint(2)
        SIGSEGV = cint(11)
        SIGTERM = cint(15)
    elif defined(macosx) or defined(linux):
      const
        SIGABRT = cint(6)
        SIGFPE = cint(8)
        SIGILL = cint(4)
        SIGINT = cint(2)
        SIGSEGV = cint(11)
        SIGTERM = cint(15)
        SIGPIPE = cint(13)
    else:
      {.error: "SIGABRT not ported to your platform".}
  else:
    var
      SIGINT {.importc: "SIGINT", nodecl.}: cint
      SIGSEGV {.importc: "SIGSEGV", nodecl.}: cint
      SIGABRT {.importc: "SIGABRT", nodecl.}: cint
      SIGFPE {.importc: "SIGFPE", nodecl.}: cint
      SIGILL {.importc: "SIGILL", nodecl.}: cint
    when defined(macosx) or defined(linux):
      var SIGPIPE {.importc: "SIGPIPE", nodecl.}: cint

when defined(macosx):
  when NoFakeVars:
    const SIGBUS = cint(10)
  else:
    var SIGBUS {.importc: "SIGBUS", nodecl.}: cint
else:
  template SIGBUS: expr = SIGSEGV

when defined(nimSigSetjmp) and not defined(nimStdSetjmp):
  proc c_longjmp(jmpb: C_JmpBuf, retval: cint) {.
    header: "<setjmp.h>", importc: "siglongjmp".}
  template c_setjmp(jmpb: C_JmpBuf): cint =
    proc c_sigsetjmp(jmpb: C_JmpBuf, savemask: cint): cint {.
      header: "<setjmp.h>", importc: "sigsetjmp".}
    c_sigsetjmp(jmpb, 0)
elif defined(nimRawSetjmp) and not defined(nimStdSetjmp):
  proc c_longjmp(jmpb: C_JmpBuf, retval: cint) {.
    header: "<setjmp.h>", importc: "_longjmp".}
  proc c_setjmp(jmpb: C_JmpBuf): cint {.
    header: "<setjmp.h>", importc: "_setjmp".}
else:
  proc c_longjmp(jmpb: C_JmpBuf, retval: cint) {.
    header: "<setjmp.h>", importc: "longjmp".}
  proc c_setjmp(jmpb: C_JmpBuf): cint {.
    header: "<setjmp.h>", importc: "setjmp".}

proc c_signal(sign: cint, handler: proc (a: cint) {.noconv.}) {.
  importc: "signal", header: "<signal.h>".}
proc c_raise(sign: cint) {.importc: "raise", header: "<signal.h>".}

proc c_fputs(c: cstring, f: File) {.importc: "fputs",
  header: "<stdio.h>".}
proc c_fgets(c: cstring, n: int, f: File): cstring  {.
  importc: "fgets", header: "<stdio.h>".}
proc c_fgetc(stream: File): int {.importc: "fgetc",
  header: "<stdio.h>".}
proc c_ungetc(c: int, f: File) {.importc: "ungetc",
  header: "<stdio.h>".}
proc c_putc(c: char, stream: File) {.importc: "putc",
  header: "<stdio.h>".}
proc c_fprintf(f: File, frmt: cstring) {.
  importc: "fprintf", header: "<stdio.h>", varargs.}
proc c_printf(frmt: cstring) {.
  importc: "printf", header: "<stdio.h>", varargs.}

proc c_fopen(filename, mode: cstring): File {.
  importc: "fopen", header: "<stdio.h>".}
proc c_fclose(f: File) {.importc: "fclose", header: "<stdio.h>".}

proc c_sprintf(buf, frmt: cstring): cint {.header: "<stdio.h>",
  importc: "sprintf", varargs, noSideEffect.}
  # we use it only in a way that cannot lead to security issues

proc c_fread(buf: pointer, size, n: int, f: File): int {.
  importc: "fread", header: "<stdio.h>".}
proc c_fseek(f: File, offset: clong, whence: int): int {.
  importc: "fseek", header: "<stdio.h>".}

proc c_fwrite(buf: pointer, size, n: int, f: File): int {.
  importc: "fwrite", header: "<stdio.h>".}

proc c_exit(errorcode: cint) {.importc: "exit", header: "<stdlib.h>".}
proc c_ferror(stream: File): bool {.
  importc: "ferror", header: "<stdio.h>".}
proc c_fflush(stream: File) {.importc: "fflush", header: "<stdio.h>".}
proc c_abort() {.importc: "abort", header: "<stdlib.h>".}
proc c_feof(stream: File): bool {.
  importc: "feof", header: "<stdio.h>".}

proc c_malloc(size: int): pointer {.importc: "malloc", header: "<stdlib.h>".}
proc c_free(p: pointer) {.importc: "free", header: "<stdlib.h>".}
proc c_realloc(p: pointer, newsize: int): pointer {.
  importc: "realloc", header: "<stdlib.h>".}

when hostOS != "standalone":
  when not declared(errno):
    when defined(NimrodVM):
      var vmErrnoWrapper {.importc.}: ptr cint
      template errno: expr =
        bind vmErrnoWrapper
        vmErrnoWrapper[]
    else:
      var errno {.importc, header: "<errno.h>".}: cint ## error variable
proc strerror(errnum: cint): cstring {.importc, header: "<string.h>".}

proc c_remove(filename: cstring): cint {.
  importc: "remove", header: "<stdio.h>".}
proc c_rename(oldname, newname: cstring): cint {.
  importc: "rename", header: "<stdio.h>".}

proc c_system(cmd: cstring): cint {.importc: "system", header: "<stdlib.h>".}
proc c_getenv(env: cstring): cstring {.importc: "getenv", header: "<stdlib.h>".}
proc c_putenv(env: cstring): cint {.importc: "putenv", header: "<stdlib.h>".}

{.pop}