Raw TCP/IP interface for lwIP

Authors: Adam Dunkels, Leon Woestenberg, Christiaan Simons

lwIP provides three Application Program's Interfaces (APIs) for programs
to use for communication with the TCP/IP code:
* low-level "core" / "callback" or "raw" API.
* higher-level "sequential" API.
* BSD-style socket API.

The sequential API provides a way for ordinary, sequential, programs
to use the lwIP stack. It is quite similar to the BSD socket API. The
model of execution is based on the blocking open-read-write-close
paradigm. Since the TCP/IP stack is event based by nature, the TCP/IP
code and the application program must reside in different execution
contexts (threads).

The socket API is a compatibility API for existing applications,
currently it is built on top of the sequential API. It is meant to
provide all functions needed to run socket API applications running
on other platforms (e.g. unix / windows etc.). However, due to limitations
in the specification of this API, there might be incompatibilities
that require small modifications of existing programs.

** Threading

lwIP started targeting single-threaded environments. When adding multi-
threading support, instead of making the core thread-safe, another
approach was chosen: there is one main thread running the lwIP core
(also known as the "tcpip_thread"). The raw API may only be used from
this thread! Application threads using the sequential- or socket API
communicate with this main thread through message passing.

      As such, the list of functions that may be called from
      other threads or an ISR is very limited! Only functions
      from these API header files are thread-safe:
      - api.h
      - netbuf.h
      - netdb.h
      - netifapi.h
      - sockets.h
      - sys.h

      Additionaly, memory (de-)allocation functions may be
      called from multiple threads (not ISR!) with NO_SYS=0
      since they are protected by SYS_LIGHTWEIGHT_PROT and/or
      semaphores.

      Only since 1.3.0, if SYS_LIGHTWEIGHT_PROT is set to 1
      and LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT is set to 1,
      pbuf_free() may also be called from another thread or
      an ISR (since only then, mem_free - for PBUF_RAM - may
      be called from an ISR: otherwise, the HEAP is only
      protected by semaphores).

** The remainder of this document discusses the "raw" API. **

The raw TCP/IP interface allows the application program to integrate
better with the TCP/IP code. Program execution is event based by
having callback functions being called from within the TCP/IP
code. The TCP/IP code and the application program both run in the same
thread. The sequential API has a much higher overhead and is not very
well suited for small systems since it forces a multithreaded paradigm
on the application.

The raw TCP/IP interface is not only faster in terms of code execution
time but is also less memory intensive. The drawback is that program
development is somewhat harder and application programs written for
the raw TCP/IP interface are more difficult to understand. Still, this
is the preferred way of writing applications that should be small in
code size and memory usage.

Both APIs can be used simultaneously by different application
programs. In fact, the sequential API is implemented as an application
program using the raw TCP/IP interface.

--- Callbacks

Program execution is driven by callbacks. Each callback is an ordinary
C function that is called from within the TCP/IP code. Every callback
function is passed the current TCP or UDP connection state as an
argument. Also, in order to be able to keep program specific state,
the callback functions are called with a program specified argument
that is independent of the TCP/IP state.

The function for setting the application connection state is:

- void tcp_arg(struct tcp_pcb *pcb, void *arg)

  Specifies the program specific state that should be passed to all
  other callback functions. The "pcb" argument is the current TCP
  connection control block, and the "arg" argument is the argument
  that will be passed to the callbacks.

--- TCP connection setup

The functions used for setting up connections is similar to that of
the sequential API and of the BSD socket API. A new TCP connection
identifier (i.e., a protocol control block - PCB) is created with the
tcp_new() function. This PCB can then be either set to listen for new
incoming connections or be explicitly connected to another host.

- struct tcp_pcb *tcp_new(void)

  Creates a new connection identifier (PCB). If memory is not
  available for creating the new pcb, NULL is returned.

- err_t tcp_bind(struct tcp_pcb *pcb, ip_addr_t *ipaddr,
                 u16_t port)

  Binds the pcb to a local IP address and port number. The IP address
  can be specified as IP_ADDR_ANY in order to bind the connection to
  all local IP addresses.

  If another connection is bound to the same port, the function will
  return ERR_USE, otherwise ERR_OK is returned.

- struct tcp_pcb *tcp_listen(struct tcp_pcb *pcb)

  Commands a pcb to start listening for incoming connections. When an
  incoming connection is accepted, the function specified with the
  tcp_accept() function will be called. The pcb will have to be bound
  to a local port with the tcp_bind() function.

  The tcp_listen() function returns a new connection identifier, and
  the one passed as an argument to the function will be
  deallocated. The reason for this behavior is that less memory is
  needed for a connection that is listening, so tcp_listen() will
  reclaim the memory needed for the original connection and allocate a
  new smaller memory block for the listening connection.

  tcp_listen() may return NULL if no memory was available for the
  listening connection. If so, the memory associated with the pcb
  passed as an argument to tcp_listen() will not be deallocated.

- struct tcp_pcb *tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)

  Same as tcp_listen, but limits the number of outstanding connections
  in the listen queue to the value specified by the backlog argument.
  To use it, your need to set TCP_LISTEN_BACKLOG=1 in your lwipopts.h.

- void tcp_accepted(struct tcp_pcb *pcb)

  Inform lwIP that an incoming connection has been accepted. This would
  usually be called from the accept callback. This allows lwIP to perform
  housekeeping tasks, such as allowing further incoming connections to be
  queued in the listen backlog.
  ATTENTION: the PCB passed in must be the listening pcb, not the pcb passed
  into the accept callback!

- void tcp_accept(struct tcp_pcb *pcb,
                  err_t (* accept)(void *arg, struct tcp_pcb *newpcb,
                                   err_t err))

  Specified the callback function that should be called when a new
  connection arrives on a listening connection.

- err_t tcp_connect(struct tcp_pcb *pcb, ip_addr_t *ipaddr,
                    u16_t port, err_t (* connected)(void *arg,
                                                    struct tcp_pcb *tpcb,
                                                    err_t err));

  Sets up the pcb to connect to the remote host and sends the
  initial SYN segment which opens the connection.

  The tcp_connect() function returns immediately; it does not wait for
  the connection to be properly setup. Instead, it will call the
  function specified as the fourth argument (the "connected" argument)
  when the connection is established. If the connection could not be
  properly established, either because the other host refused the
  connection or because the other host didn't answer, the "err"
  callback function of this pcb (registered with tcp_err, see below)
  will be called.

  The tcp_connect() function can return ERR_MEM if no memory is
  available for enqueueing the SYN segment. If the SYN indeed was
  enqueued successfully, the tcp_connect() function returns ERR_OK.

--- Sending TCP data

TCP data is sent by enqueueing the data with a call to
tcp_write(). When the data is successfully transmitted to the remote
host, the application will be notified with a call to a specified
callback function.

- err_t tcp_write(struct tcp_pcb *pcb, const void *dataptr, u16_t len,
                  u8_t apiflags)

  Enqueues the data pointed to by the argument dataptr. The length of
  the data is passed as the len parameter. The apiflags can be one or more of:
  - TCP_WRITE_FLAG_COPY: indicates whether the new memory should be allocated
    for the data to be copied into. If this flag is not given, no new memory
    should be allocated and the data should only be referenced by pointer. This
    also means that the memory behind dataptr must not change until the data is
    ACKed by the remote host
  - TCP_WRITE_FLAG_MORE: indicates that more data follows. If this is given,
    the PSH flag is set in the last segment created by this call to tcp_write.
    If this flag is given, the PSH flag is not set.

  The tcp_write() function will fail and return ERR_MEM if the length
  of the data exceeds the current send buffer size or if the length of
  the queue of outgoing segment is larger than the upper limit defined
  in lwipopts.h. The number of bytes available in the output queue can
  be retrieved with the tcp_sndbuf() function.

  The proper way to use this function is to call the function with at
  most tcp_sndbuf() bytes of data. If the function returns ERR_MEM,
  the application should wait until some of the currently enqueued
  data has been successfully received by the other host and try again.

- void tcp_sent(struct tcp_pcb *pcb,
                err_t (* sent)(void *arg, struct tcp_pcb *tpcb,
                u16_t len))

  Specifies the callback function that should be called when data has
  successfully been received (i.e., acknowledged) by the remote
  host. The len argument passed to the callback function gives the
  amount bytes that was acknowledged by the last acknowledgment.

--- Receiving TCP data

TCP data reception is callback based - an application specified
callback function is called when new data arrives. When the
application has taken the data, it has to call the tcp_recved()
function to indicate that TCP can advertise increase the receive
window.

- void tcp_recv(struct tcp_pcb *pcb,
                err_t (* recv)(void *arg, struct tcp_pcb *tpcb,
                               struct pbuf *p, err_t err))

  Sets the callback function that will be called when new data
  arrives. The callback function will be passed a NULL pbuf to
  indicate that the remote host has closed the connection. If
  there are no errors and the callback function is to return
  ERR_OK, then it must free the pbuf. Otherwise, it must not
  free the pbuf so that lwIP core code can store it.

- void tcp_recved(struct tcp_pcb *pcb, u16_t len)

  Must be called when the application has received the data. The len
  argument indicates the length of the received data.

--- Application polling

When a connection is idle (i.e., no data is either transmitted or
received), lwIP will repeatedly poll the application by calling a
specified callback function. This can be used either as a watchdog
timer for killing connections that have stayed idle for too long, or
as a method of waiting for memory to become available. For instance,
if a call to tcp_write() has failed because memory wasn't available,
the application may use the polling functionality to call tcp_write()
again when the connection has been idle for a while.

- void tcp_poll(struct tcp_pcb *pcb,
                err_t (* poll)(void *arg, struct tcp_pcb *tpcb),
                u8_t interval)

  Specifies the polling interval and the callback function that should
  be called to poll the application. The interval is specified in
  number of TCP coarse grained timer shots, which typically occurs
  twice a second. An interval of 10 means that the application would
  be polled every 5 seconds.

--- Closing and aborting connections

- err_t tcp_close(struct tcp_pcb *pcb)

  Closes the connection. The function may return ERR_MEM if no memory
  was available for closing the connection. If so, the application
  should wait and try again either by using the acknowledgment
  callback or the polling functionality. If the close succeeds, the
  function returns ERR_OK.

  The pcb is deallocated by the TCP code after a call to tcp_close().

- void tcp_abort(struct tcp_pcb *pcb)

  Aborts the connection by sending a RST (reset) segment to the remote
  host. The pcb is deallocated. This function never fails.

  ATTENTION: When calling this from one of the TCP callbacks, make
  sure you always return ERR_ABRT (and never return ERR_ABRT otherwise
  or you will risk accessing deallocated memory or memory leaks!

If a connection is aborted because of an error, the application is
alerted of this event by the err callback. Errors that might abort a
connection are when there is a shortage of memory. The callback
function to be called is set using the tcp_err() function.

- void tcp_err(struct tcp_pcb *pcb, void (* err)(void *arg,
       err_t err))

  The error callback function does not get the pcb passed to it as a
  parameter since the pcb may already have been deallocated.

--- Lower layer TCP interface

TCP provides a simple interface to the lower layers of the
system. During system initialization, the function tcp_init() has
to be called before any other TCP function is called. When the system
is running, the two timer functions tcp_fasttmr() and tcp_slowtmr()
must be called with regular intervals. The tcp_fasttmr() should be
called every TCP_FAST_INTERVAL milliseconds (defined in tcp.h) and
tcp_slowtmr() should be called every TCP_SLOW_INTERVAL milliseconds.

--- UDP interface

The UDP interface is similar to that of TCP, but due to the lower
level of complexity of UDP, the interface is significantly simpler.

- struct udp_pcb *udp_new(void)

  Creates a new UDP pcb which can be used for UDP communication. The
  pcb is not active until it has either been bound to a local address
  or connected to a remote address.

- void udp_remove(struct udp_pcb *pcb)

  Removes and deallocates the pcb.

- err_t udp_bind(struct udp_pcb *pcb, ip_addr_t *ipaddr,
                 u16_t port)

  Binds the pcb to a local address. The IP-address argument "ipaddr"
  can be IP_ADDR_ANY to indicate that it should listen to any local IP
  address. The function currently always return ERR_OK.

- err_t udp_connect(struct udp_pcb *pcb, ip_addr_t *ipaddr,
                    u16_t port)

  Sets the remote end of the pcb. This function does not generate any
  network traffic, but only set the remote address of the pcb.

- err_t udp_disconnect(struct udp_pcb *pcb)

  Remove the remote end of the pcb. This function does not generate
  any network traffic, but only removes the remote address of the pcb.

- err_t udp_send(struct udp_pcb *pcb, struct pbuf *p)

  Sends the pbuf p. The pbuf is not deallocated.

- void udp_recv(struct udp_pcb *pcb,
                void (* recv)(void *arg, struct udp_pcb *upcb,
                                         struct pbuf *p,
                                         ip_addr_t *addr,
                                         u16_t port),
                              void *recv_arg)

  Specifies a callback function that should be called when a UDP
  datagram is received.

--- System initalization

A truly complete and generic sequence for initializing the lwip stack
cannot be given because it depends on the build configuration (lwipopts.h)
and additional initializations for your runtime environment (e.g. timers).

We can give you some idea on how to proceed when using the raw API.
We assume a configuration using a single Ethernet netif and the
UDP and TCP transport layers, IPv4 and the DHCP client.

Call these functions in the order of appearance:

- stats_init()

  Clears the structure where runtime statistics are gathered.

- sys_init()

  Not of much use since we set the NO_SYS 1 option in lwipopts.h,
  to be called for easy configuration changes.

- mem_init()

  Initializes the dynamic memory heap defined by MEM_SIZE.

- memp_init()

  Initializes the memory pools defined by MEMP_NUM_x.

- pbuf_init()

  Initializes the pbuf memory pool defined by PBUF_POOL_SIZE.

- etharp_init()

  Initializes the ARP table and queue.
  Note: you must call etharp_tmr at a ARP_TMR_INTERVAL (5 seconds) regular interval
  after this initialization.

- ip_init()

  Doesn't do much, it should be called to handle future changes.

- udp_init()

  Clears the UDP PCB list.

- tcp_init()

  Clears the TCP PCB list and clears some internal TCP timers.
  Note: you must call tcp_fasttmr() and tcp_slowtmr() at the
  predefined regular intervals after this initialization.

- netif_add(struct netif *netif, ip_addr_t *ipaddr,
            ip_addr_t *netmask, ip_addr_t *gw,
            void *state, err_t (* init)(struct netif *netif),
            err_t (* input)(struct pbuf *p, struct netif *netif))

  Adds your network interface to the netif_list. Allocate a struct
  netif and pass a pointer to this structure as the first argument.
  Give pointers to cleared ip_addr structures when using DHCP,
  or fill them with sane numbers otherwise. The state pointer may be NULL.

  The init function pointer must point to a initialization function for
  your ethernet netif interface. The following code illustrates it's use.

  err_t netif_if_init(struct netif *netif)
  {
    u8_t i;

    for(i = 0; i < ETHARP_HWADDR_LEN; i++) netif->hwaddr[i] = some_eth_addr[i];
    init_my_eth_device();
    return ERR_OK;
  }

  For ethernet drivers, the input function pointer must point to the lwip
  function ethernet_input() declared in "netif/etharp.h". Other drivers
  must use ip_input() declared in "lwip/ip.h".

- netif_set_default(struct netif *netif)

  Registers the default network interface.

- netif_set_up(struct netif *netif)

  When the netif is fully configured this function must be called.

- dhcp_start(struct netif *netif)

  Creates a new DHCP client for this interface on the first call.
  Note: you must call dhcp_fine_tmr() and dhcp_coarse_tmr() at
  the predefined regular intervals after starting the client.

  You can peek in the netif->dhcp struct for the actual DHCP status.

--- Optimalization hints

The first thing you want to optimize is the lwip_standard_checksum()
routine from src/core/inet.c. You can override this standard
function with the #define LWIP_CHKSUM <your_checksum_routine>.

There are C examples given in inet.c or you might want to
craft an assembly function for this. RFC1071 is a good
introduction to this subject.

Other significant improvements can be made by supplying
assembly or inline replacements for htons() and htonl()
if you're using a little-endian architecture.
#define LWIP_PLATFORM_BYTESWAP 1
#define LWIP_PLATFORM_HTONS(x) <your_htons>
#define LWIP_PLATFORM_HTONL(x) <your_htonl>

Check your network interface driver if it reads at
a higher speed than the maximum wire-speed. If the
hardware isn't serviced frequently and fast enough
buffer overflows are likely to occur.

E.g. when using the cs8900 driver, call cs8900if_service(ethif)
as frequently as possible. When using an RTOS let the cs8900 interrupt
wake a high priority task that services your driver using a binary
semaphore or event flag. Some drivers might allow additional tuning
to match your application and network.

For a production release it is recommended to set LWIP_STATS to 0.
Note that speed performance isn't influenced much by simply setting
high values to the memory options.

For more optimization hints take a look at the lwIP wiki.

--- Zero-copy MACs

To achieve zero-copy on transmit, the data passed to the raw API must
remain unchanged until sent. Because the send- (or write-)functions return
when the packets have been enqueued for sending, data must be kept stable
after that, too.

This implies that PBUF_RAM/PBUF_POOL pbufs passed to raw-API send functions
must *not* be reused by the application unless their ref-count is 1.

For no-copy pbufs (PBUF_ROM/PBUF_REF), data must be kept unchanged, too,
but the stack/driver will/must copy PBUF_REF'ed data when enqueueing, while
PBUF_ROM-pbufs are just enqueued (as ROM-data is expected to never change).

Also, data passed to tcp_write without the copy-flag must not be changed!

Therefore, be careful which type of PBUF you use and if you copy TCP data
or not!

{'repo_name': 'xvisor/xvisor', 'stars': '283', 'repo_language': 'C', 'file_name': 'mutex4.c', 'mime_type': 'text/x-c', 'hash': 4374509168246791826, 'source_dataset': 'data'}


# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

### [10.0.2-beta.1](https://github.com/just-jeb/angular-builders/compare/@angular-builders/timestamp@10.0.2-beta.0...@angular-builders/timestamp@10.0.2-beta.1) (2020-09-20)

**Note:** Version bump only for package @angular-builders/timestamp

## 10.0.2-beta.0 (2020-09-09)

* Fix CHANGELOG links (#834) ([001b4ab](https://github.com/just-jeb/angular-builders/commit/001b4ab)), closes [#834](https://github.com/just-jeb/angular-builders/issues/834)

## 10.0.1 (2020-09-09)

**Note:** Version bump only for package @angular-builders/timestamp

## 10.0.1-beta.12 (2020-09-06)

- chore: update dependencies (#831) ([b475080](https://github.com/just-jeb/angular-builders/commit/b475080)), closes [#831](https://github.com/just-jeb/angular-builders/issues/831)

## 10.0.1-beta.11 (2020-09-04)

- chore(deps-dev): bump typescript from 3.9.7 to 4.0.2 ([418d8ed](https://github.com/just-jeb/angular-builders/commit/418d8ed))

## 10.0.1-beta.10 (2020-09-03)

- chore(deps): bump @angular-devkit/build-angular ([1e6ea84](https://github.com/just-jeb/angular-builders/commit/1e6ea84))

## 10.0.1-beta.9 (2020-09-01)

- chore(deps): bump ts-node from 8.10.2 to 9.0.0 ([7de38ff](https://github.com/just-jeb/angular-builders/commit/7de38ff))

## 10.0.1-beta.8 (2020-09-01)

- chore(deps): bump @angular-devkit/build-angular ([f0b361a](https://github.com/just-jeb/angular-builders/commit/f0b361a))

## 10.0.1-beta.7 (2020-09-01)

- chore(deps-dev): bump karma from 5.1.1 to 5.2.0 ([a58b0d6](https://github.com/just-jeb/angular-builders/commit/a58b0d6))

## 10.0.1-beta.6 (2020-08-21)

- chore(deps): bump @angular-devkit/build-angular ([ac8c8f3](https://github.com/just-jeb/angular-builders/commit/ac8c8f3))

## 10.0.1-beta.5 (2020-08-18)

- chore(deps): bump zone.js from 0.10.3 to 0.11.0 ([ed4e820](https://github.com/just-jeb/angular-builders/commit/ed4e820))

## 10.0.1-beta.4 (2020-08-13)

- chore(deps): bump @angular-devkit/build-angular ([fe2fd7b](https://github.com/just-jeb/angular-builders/commit/fe2fd7b))

## 10.0.1-beta.3 (2020-08-11)

- chore(deps-dev): bump karma-jasmine from 3.3.1 to 4.0.0 ([03cc6c7](https://github.com/just-jeb/angular-builders/commit/03cc6c7))

## 10.0.1-beta.2 (2020-08-01)

- chore(deps): bump @angular-devkit/build-angular ([4d85c19](https://github.com/just-jeb/angular-builders/commit/4d85c19))

## 10.0.1-beta.1 (2020-07-30)

- chore(deps-dev): bump jasmine-core from 3.5.0 to 3.6.0 ([7928992](https://github.com/just-jeb/angular-builders/commit/7928992))

## 10.0.1-beta.0 (2020-07-30)

- chore(deps): bump @angular-devkit/build-angular ([1bb4f68](https://github.com/just-jeb/angular-builders/commit/1bb4f68))

## 10.0.0 (2020-07-21)

- chore(deps): bump @angular-devkit/build-angular ([9aaa8b3](https://github.com/just-jeb/angular-builders/commit/9aaa8b3))

## 10.0.0-beta.5 (2020-07-09)

- chore(deps): bump @angular-devkit/build-angular ([f83f2d7](https://github.com/just-jeb/angular-builders/commit/f83f2d7))

## 10.0.0-beta.4 (2020-07-02)

- chore(deps-dev): bump codelyzer from 5.2.2 to 6.0.0 ([356754d](https://github.com/just-jeb/angular-builders/commit/356754d))

## 10.0.0-beta.3 (2020-07-02)

- chore(deps): bump rxjs from 6.5.5 to 6.6.0 ([9ede4ae](https://github.com/just-jeb/angular-builders/commit/9ede4ae))

## 10.0.0-beta.2 (2020-07-02)

- chore(deps): bump @angular-devkit/build-angular ([89525ae](https://github.com/just-jeb/angular-builders/commit/89525ae))

## 10.0.0-beta.1 (2020-06-25)

- chore(deps-dev): bump karma from 5.0.9 to 5.1.0 ([6399200](https://github.com/just-jeb/angular-builders/commit/6399200))

## 10.0.0-beta.0 (2020-06-25)

- build!: update to Angular 10 (#782) ([409f356](https://github.com/just-jeb/angular-builders/commit/409f356)), closes [#782](https://github.com/just-jeb/angular-builders/issues/782)

## 9.0.3-beta.12 (2020-06-25)

- chore(deps): bump @angular/animations from 9.1.11 to 10.0.0 ([14ab37a](https://github.com/just-jeb/angular-builders/commit/14ab37a))

## 9.0.3-beta.11 (2020-06-25)

- chore(deps): bump @angular/router from 9.1.11 to 10.0.0 ([de3454e](https://github.com/just-jeb/angular-builders/commit/de3454e))

## 9.0.3-beta.10 (2020-06-25)

- chore(deps-dev): bump @angular/cli from 9.1.9 to 10.0.0 ([ad877c5](https://github.com/just-jeb/angular-builders/commit/ad877c5))

## 9.0.3-beta.9 (2020-06-25)

- chore(deps-dev): bump @angular/language-service from 9.1.11 to 10.0.0 ([4af6ae3](https://github.com/just-jeb/angular-builders/commit/4af6ae3))

## 9.0.3-beta.8 (2020-06-25)

- chore(deps): bump @angular/forms from 9.1.11 to 10.0.0 ([d25b43c](https://github.com/just-jeb/angular-builders/commit/d25b43c))
- chore(deps): bump @angular/platform-browser from 9.1.11 to 10.0.0 ([1665f53](https://github.com/just-jeb/angular-builders/commit/1665f53))

## 9.0.3-beta.7 (2020-06-25)

- chore(deps): bump @angular/common from 9.1.11 to 10.0.0 ([c3d2e3a](https://github.com/just-jeb/angular-builders/commit/c3d2e3a))

## 9.0.3-beta.6 (2020-06-25)

- chore(deps): bump @angular/platform-browser-dynamic ([4c7f86f](https://github.com/just-jeb/angular-builders/commit/4c7f86f))

## 9.0.3-beta.5 (2020-06-23)

- chore(deps): bump ts-node from 8.9.1 to 8.10.2 ([7448e35](https://github.com/just-jeb/angular-builders/commit/7448e35))

## 9.0.3-beta.4 (2020-06-23)

- chore(deps-dev): bump @types/node from 13.13.12 to 14.0.13 ([76ee36a](https://github.com/just-jeb/angular-builders/commit/76ee36a))

## 9.0.3-beta.3 (2020-06-23)

- chore(deps-dev): bump karma from 5.0.9 to 5.1.0 ([cef8925](https://github.com/just-jeb/angular-builders/commit/cef8925))

## 9.0.3-beta.2 (2020-06-23)

- chore(deps-dev): bump karma-coverage-istanbul-reporter ([910660d](https://github.com/just-jeb/angular-builders/commit/910660d))

## 9.0.3-beta.1 (2020-06-23)

- chore(deps-dev): bump protractor from 5.4.4 to 7.0.0 ([2c14a2a](https://github.com/just-jeb/angular-builders/commit/2c14a2a))

## 9.0.3-beta.0 (2020-06-23)

- chore(deps-dev): bump karma-jasmine from 3.1.1 to 3.3.1 ([9ca1a13](https://github.com/just-jeb/angular-builders/commit/9ca1a13))

## 9.0.2 (2020-06-23)

**Note:** Version bump only for package @angular-builders/timestamp

## 9.0.2-beta.1 (2020-04-20)

- chore(deps): bump ts-node from 8.8.2 to 8.9.0 ([c78c0d3](https://github.com/just-jeb/angular-builders/commit/c78c0d3))

## 9.0.2-beta.0 (2020-04-10)

- chore(deps-dev): bump karma from 4.4.1 to 5.0.1 ([ca08d01](https://github.com/just-jeb/angular-builders/commit/ca08d01))

## 9.0.1 (2020-04-05)

**Note:** Version bump only for package @angular-builders/timestamp

## 9.0.1-beta.5 (2020-03-30)

- chore(deps-dev): bump typescript from 3.7.5 to 3.8.3 ([8fc1842](https://github.com/just-jeb/angular-builders/commit/8fc1842))

## 9.0.1-beta.4 (2020-03-29)

- chore(deps-dev): bump tslint from 5.20.1 to 6.1.0 ([da8bd20](https://github.com/just-jeb/angular-builders/commit/da8bd20))

## 9.0.1-beta.3 (2020-03-29)

- fix: adjust devkit version range to fit 0.9xx.0 (#709) ([99e061f](https://github.com/just-jeb/angular-builders/commit/99e061f)), closes [#709](https://github.com/just-jeb/angular-builders/issues/709)

## 9.0.1-beta.2 (2020-03-22)

- chore(deps-dev): bump jasmine-spec-reporter from 4.2.1 to 5.0.0 ([df9710a](https://github.com/just-jeb/angular-builders/commit/df9710a))

## 9.0.1-beta.1 (2020-03-22)

- chore(deps): bump ts-node from 8.7.0 to 8.8.0 ([38659ab](https://github.com/just-jeb/angular-builders/commit/38659ab))

## 9.0.1-beta.0 (2020-03-18)

- chore(deps): bump ts-node from 8.6.2 to 8.7.0 ([04069c3](https://github.com/just-jeb/angular-builders/commit/04069c3))

## 9.0.0 (2020-02-23)

- ci(release): publish ([f0ce8bc](https://github.com/just-jeb/angular-builders/commit/f0ce8bc))
- docs: update README and MIGRATION for v9 (#685) ([92ec06d](https://github.com/just-jeb/angular-builders/commit/92ec06d)), closes [#685](https://github.com/just-jeb/angular-builders/issues/685)

## 9.0.0-beta.3 (2020-02-23)

- docs: update README and MIGRATION for v9 (#685) ([92ec06d](https://github.com/just-jeb/angular-builders/commit/92ec06d)), closes [#685](https://github.com/just-jeb/angular-builders/issues/685)

## 9.0.0-beta.2 (2020-01-28)

- docs: add 'next' tag badges (#672) ([441adec](https://github.com/just-jeb/angular-builders/commit/441adec)), closes [#672](https://github.com/just-jeb/angular-builders/issues/672)

## 9.0.0-beta.1 (2020-01-25)

- chore(deps-dev): bump karma-jasmine from 3.0.3 to 3.1.0 ([bf4f11c](https://github.com/just-jeb/angular-builders/commit/bf4f11c))
- chore(deps-dev): bump typescript from 3.6.4 to 3.7.5 ([5c0c82c](https://github.com/just-jeb/angular-builders/commit/5c0c82c))
- chore(deps): bump ts-node from 8.5.4 to 8.6.0 ([61c830a](https://github.com/just-jeb/angular-builders/commit/61c830a))

## 9.0.0-beta.0 (2020-01-04)

- chore(deps-dev): bump @types/jasmine from 3.4.6 to 3.5.0 ([ec2bb8b](https://github.com/just-jeb/angular-builders/commit/ec2bb8b))
- chore(deps-dev): bump @types/node from 12.12.22 to 13.1.0 ([3ad35a6](https://github.com/just-jeb/angular-builders/commit/3ad35a6))
- chore(deps-dev): bump @types/node from 12.12.24 to 13.1.4 ([8c603c8](https://github.com/just-jeb/angular-builders/commit/8c603c8))
- chore(deps-dev): bump karma-jasmine from 2.0.1 to 3.0.0 ([cfa271f](https://github.com/just-jeb/angular-builders/commit/cfa271f))
- ci: use verdaccio for e2e ([23f9235](https://github.com/just-jeb/angular-builders/commit/23f9235))
- build!: direct dependency on @angular-devkit 9 ([6f0ac12](https://github.com/just-jeb/angular-builders/commit/6f0ac12))

## [8.3.2](https://github.com/just-jeb/angular-builders/tree/master/packages/timestamp/compare/@angular-builders/timestamp@8.3.1...@angular-builders/timestamp@8.3.2) (2019-11-29)

**Note:** Version bump only for package @angular-builders/timestamp

## [8.3.1](https://github.com/just-jeb/angular-builders/tree/master/packages/timestamp/compare/@angular-builders/timestamp@8.3.0...@angular-builders/timestamp@8.3.1) (2019-11-19)

**Note:** Version bump only for package @angular-builders/timestamp

{'repo_name': 'just-jeb/angular-builders', 'stars': '741', 'repo_language': 'TypeScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -441646585117672674, 'source_dataset': 'data'}


#ifndef ASMARM_ARCH_MMC_H
#define ASMARM_ARCH_MMC_H

#include <linux/mmc/host.h>

struct device;

/* board specific SDHC data, optional.
 * If not present, a writable card with 3,3V is assumed.
 */
struct imxmmc_platform_data {
	/* Return values for the get_ro callback should be:
	 *   0 for a read/write card
	 *   1 for a read-only card
	 *   -ENOSYS when not supported (equal to NULL callback)
	 *   or a negative errno value when something bad happened
	 */
	int (*get_ro)(struct device *);

	/* board specific hook to (de)initialize the SD slot.
	 * The board code can call 'handler' on a card detection
	 * change giving data as argument.
	 */
	int (*init)(struct device *dev, irq_handler_t handler, void *data);
	void (*exit)(struct device *dev, void *data);

	/* available voltages. If not given, assume
	 * MMC_VDD_32_33 | MMC_VDD_33_34
	 */
	unsigned int ocr_avail;

	/* adjust slot voltage */
	void (*setpower)(struct device *, unsigned int vdd);

	/* enable card detect using DAT3 */
	int dat3_card_detect;
};

#endif

{'repo_name': 'MotorolaMobilityLLC/kernel-msm', 'stars': '447', 'repo_language': 'C', 'file_name': 'uncompress.h', 'mime_type': 'text/x-c', 'hash': -4270508486221474844, 'source_dataset': 'data'}


/*
-----------------------------------------------------------------------------
This source file is part of OGRE
    (Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/

Copyright (c) 2000-2006 Torus Knot Software Ltd
Also see acknowledgements in Readme.html

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt.

You may alternatively use this source under the terms of a specific version of
the OGRE Unrestricted License provided you have obtained such a license from
Torus Knot Software Ltd.
-----------------------------------------------------------------------------
*/
#ifndef __PlatformInformation_H__
#define __PlatformInformation_H__

#include "OgrePrerequisites.h"

namespace Ogre {
//
// TODO: Puts following macros into OgrePlatform.h?
//

/* Initial CPU stuff to set.
*/
#define OGRE_CPU_UNKNOWN    0
#define OGRE_CPU_X86        1
#define OGRE_CPU_PPC        2

/* Find CPU type
*/
#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) || \
    (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
#   define OGRE_CPU OGRE_CPU_X86

#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE && defined(__BIG_ENDIAN__)
#   define OGRE_CPU OGRE_CPU_PPC
#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
#	define OGRE_CPU OGRE_CPU_X86

#else
#   define OGRE_CPU OGRE_CPU_UNKNOWN
#endif

/* Find how to declare aligned variable.
*/
#if OGRE_COMPILER == OGRE_COMPILER_MSVC
#   define OGRE_ALIGNED_DECL(type, var, alignment)  __declspec(align(alignment)) type var

#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
#   define OGRE_ALIGNED_DECL(type, var, alignment)  type var __attribute__((__aligned__(alignment)))

#else
#   define OGRE_ALIGNED_DECL(type, var, alignment)  type var
#endif

/** Find perfect alignment (should supports SIMD alignment if SIMD available)
*/
#if OGRE_CPU == OGRE_CPU_X86
#   define OGRE_SIMD_ALIGNMENT  16

#else
#   define OGRE_SIMD_ALIGNMENT  16
#endif

/* Declare variable aligned to SIMD alignment.
*/
#define OGRE_SIMD_ALIGNED_DECL(type, var)   OGRE_ALIGNED_DECL(type, var, OGRE_SIMD_ALIGNMENT)

/* Define whether or not Ogre compiled with SSE supports.
*/
#if OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_X86 && OGRE_COMPILER == OGRE_COMPILER_MSVC
#   define __OGRE_HAVE_SSE  1
#elif OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_X86 && OGRE_COMPILER == OGRE_COMPILER_GNUC
#   define __OGRE_HAVE_SSE  1
#endif

#ifndef __OGRE_HAVE_SSE
#   define __OGRE_HAVE_SSE  0
#endif

    /** Class which provides the run-time platform information Ogre runs on.
        @remarks
            Ogre is designed to be platform-independent, but some platform
            and run-time environment specific optimised functions are built-in
            to maximise performance, and those special optimised routines are
            need to determine run-time environment for select variant executing
            path.
        @par
            This class manages that provides a couple of functions to determine
            platform information of the run-time environment.
        @note
            This class is supposed to use by advanced user only.
    */
    class _OgreExport PlatformInformation
    {
    public:

        /// Enum describing the different CPU features we want to check for, platform-dependent
        enum CpuFeatures
        {
#if OGRE_CPU == OGRE_CPU_X86
            CPU_FEATURE_SSE         = 1 << 0,
            CPU_FEATURE_SSE2        = 1 << 1,
            CPU_FEATURE_SSE3        = 1 << 2,
            CPU_FEATURE_MMX         = 1 << 3,
            CPU_FEATURE_MMXEXT      = 1 << 4,
            CPU_FEATURE_3DNOW       = 1 << 5,
            CPU_FEATURE_3DNOWEXT    = 1 << 6,
            CPU_FEATURE_CMOV        = 1 << 7,
            CPU_FEATURE_TSC         = 1 << 8,
            CPU_FEATURE_FPU         = 1 << 9,
            CPU_FEATURE_PRO         = 1 << 10,
            CPU_FEATURE_HTT         = 1 << 11,
#endif

            CPU_FEATURE_NONE        = 0
        };

        /** Gets a string of the CPU identifier.
        @note
            Actual detecting are performs in the first time call to this function,
            and then all future calls with return internal cached value.
        */
        static const String& getCpuIdentifier(void);

        /** Gets a or-masked of enum CpuFeatures that are supported by the CPU.
        @note
            Actual detecting are performs in the first time call to this function,
            and then all future calls with return internal cached value.
        */
        static uint getCpuFeatures(void);

		/** Gets whether a specific feature is supported by the CPU.
		@note
			Actual detecting are performs in the first time call to this function,
			and then all future calls with return internal cached value.
		*/
		static bool hasCpuFeature(CpuFeatures feature);

		/** Write the CPU information to the passed in Log */
		static void log(Log* pLog);

    };

}

#endif  // __PlatformInformation_H__

{'repo_name': 'unconed/NFSpace', 'stars': '109', 'repo_language': 'C', 'file_name': 'project.pbxproj', 'mime_type': 'text/plain', 'hash': 5979020096026429260, 'source_dataset': 'data'}


@**
* Yobi, Project Hosting SW
*
* Copyright 2014 NAVER Corp.
* http://yobi.io
*
* @author Keesun
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, form: play.data.Form[Organization])

@siteLayout("app.name", utils.MenuType.NONE) {

            <form action="@routes.OrganizationApp.newOrganization()" method="post" name="new-org" class="frm-wrap">
                <legend>
                    @Messages("title.newOrganization")
                </legend>

                                @requestHeader.flash.get("warning") match {
                                  case Some(msg) => { @Messages(msg) }
                                  case None => { }
                                }

                        @Messages("organization.name.placeholder")

                        <input id="name" type="text" name="name" class="text" placeholder="" maxlength="250" value="@form.field("name").value()" />

                        @Messages("organization.description.placeholder")

                        <textarea id="descr" name="descr" class="text textarea.span4" style="resize: vertical;" >@form.field("descr").value()</textarea>

                    <button class="ybtn ybtn-success">
                         @Messages("organization.create")
                    </button>
                    @Messages("button.cancel")

            </form>

}

{'repo_name': 'yona-projects/yona', 'stars': '381', 'repo_language': 'JavaScript', 'file_name': 'yobi.CodeTemplate.js', 'mime_type': 'text/plain', 'hash': 2086060660680675603, 'source_dataset': 'data'}


/* The contents of this file are subject to the Netscape Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/NPL/
 *
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 * The Original Code is Mozilla Communicator client code, released March
 * 31, 1998.
 *
 * The Initial Developer of the Original Code is Netscape Communications
 * Corporation. Portions created by Netscape are
 * Copyright (C) 1998 Netscape Communications Corporation. All
 * Rights Reserved.
 *
 * Contributor(s):
 *
 */
/**
    File Name:          15.1-1-n.js
    ECMA Section:       The global object
    Description:

    The global object does not have a [[Construct]] property; it is not
    possible to use the global object as a constructor with the new operator.

    Author:             christine@netscape.com
    Date:               12 november 1997
*/

    var SECTION = "15.1-1-n";
    var VERSION = "ECMA_1";
    startTest();
    var TITLE   = "The Global Object";

    writeHeaderToLog( SECTION + " "+ TITLE);

    var testcases = new Array();

    testcases[tc] = new TestCase(   SECTION,
                                    "var MY_GLOBAL = new this()",
                                    "error",
                                    "var MY_GLOBAL = new this()" );

    test();

function test() {
    for ( tc=0; tc < testcases.length; tc++ ) {
        testcases[tc].actual = eval(testcases[tc].actual);

        testcases[tc].passed = writeTestCaseResult(
                            testcases[tc].expect,
                            testcases[tc].actual,
                            testcases[tc].description +" = "+
                            testcases[tc].actual );

        testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
    }
    stopTest();
    return ( testcases );
}

{'repo_name': 'toshok/echojs', 'stars': '424', 'repo_language': 'JavaScript', 'file_name': 'format', 'mime_type': 'text/plain', 'hash': -2537224521567333502, 'source_dataset': 'data'}


{'repo_name': 'BlueBrain/nexus', 'stars': '149', 'repo_language': 'Scala', 'file_name': 'PostgresDocker.scala', 'mime_type': 'text/plain', 'hash': -2123873867312777776, 'source_dataset': 'data'}