This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <net/if.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
struct if_nameindex *if_nidxs, *intf; | |
if (!(if_nidxs = if_nameindex())) | |
goto exit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#if defined(DEBUG) | |
#define PRINT(_fmt_, ...) printf(_fmt_, __VA_ARGS__); | |
#else | |
#define PRINT(_fmt_, ...) | |
#endif | |
/* works in the range: [0x1, 0x7FFF FFFF FFFF FFFF] */ | |
static size_t upper_power_of_two(size_t v) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#define DO_PRINT 0 | |
#define TEST_BITS(_n_, _do_print_) do { \ | |
unsigned calculated = number_of_set_bits(_n_); \ | |
unsigned actual = number_of_set_bits_naive(_n_); \ | |
if (_do_print_) \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <string.h> | |
#include <stdio.h> | |
#define ALIGN_OPTIONAL_ARGUMENT(_argc, _argv, _optstring, _optarg, _optind) \ | |
do { \ | |
if (!(_optarg) && (_optind) < (_argc) && \ | |
(((_argv)[(_optind)][0] != '-') || \ | |
!strchr(_optstring, (_argv)[(_optind)][1]))) { \ | |
(_optarg) = (_argv)[(_optind)++]; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set MORNING=6:00am-8:00am | |
set SCHOOL=8:00am-1:00pm | |
set AFTERNOON=1:00pm-6:00pm | |
set EVENING=6:00pm-12:00am | |
set NIGHT=12:00am-6:00am | |
set LIMIT=SU-SA,%AFTERNOON%;F,%EVENING%;SA,%MORNING%,%SCHOOL% | |
rem echo MORNING:%MORNING% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <dirent.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
static int path_scan(char *path) | |
{ | |
DIR *d; | |
struct dirent *ent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/select.h> | |
#include <stdarg.h> | |
#define CURSOR_DISSABLE "\E[?25l" | |
#define CURSOR_ENABLE "\E[?25h" | |
#define ARRAY_SZ(ARR) (sizeof(ARR) / sizeof(ARR[0])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define CLEAR "\033[00;00;00m" | |
static void p_colour(int c1, int c2) | |
{ | |
char col[10]; | |
sprintf(col, "\033[%d;%dm", c1, c2); | |
printf("\"\\033[%d;%dm\" = %scolour%s\n", c1, c2, col, CLEAR); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <gnu/libc-version.h> | |
int main (void) | |
{ | |
puts(gnu_get_libc_version()); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# From Gerrit Code Review 2.1.2-rc2-33-g7e30c72 | |
# | |
# Part of Gerrit Code Review (http://code.google.com/p/gerrit/) | |
# | |
# Copyright (C) 2009 The Android Open Source Project | |
# | |
# 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 |
NewerOlder