Logo Search packages:      
Sourcecode: libnl version File versions  Download package

void nl_new_line ( struct nl_dump_params params,
int  line 
)

Handle a new line while dumping

  • params Dumping parameters
  • line Number of lines dumped already.

This function must be called before dumping any onto a new line. It will ensure proper prefixing as specified by the dumping parameters.

Note:
This function will NOT dump any newlines itself

Definition at line 725 of file utils.c.

References nl_dump_params::dp_buf, nl_dump_params::dp_buflen, nl_dump_params::dp_fd, nl_dump_params::dp_nl_cb, and nl_dump_params::dp_prefix.

{
      if (params->dp_prefix) {
            int i;
            for (i = 0; i < params->dp_prefix; i++) {
                  if (params->dp_fd)
                        fprintf(params->dp_fd, " ");
                  else if (params->dp_buf)
                        strncat(params->dp_buf, " ",
                              params->dp_buflen -
                              sizeof(params->dp_buf) - 1);
            }
      }

      if (params->dp_nl_cb)
            params->dp_nl_cb(params, line);
}

Generated by  Doxygen 1.6.0   Back to index